mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-01-19 21:00:08 +08:00
648c9a9608
* opti(armature-lock): parallelize burst jobs for armature lock processing * feat: continue armature tracking when the MAMA GameObject is disabled Closes: #500 * feat: add global toggle for armature locking Closes: #484
33 lines
910 B
C#
33 lines
910 B
C#
using System;
|
|
|
|
namespace nadena.dev.modular_avatar.core.armature_lock
|
|
{
|
|
internal static class UpdateLoopController
|
|
{
|
|
internal static event Action OnArmatureLockPrepare;
|
|
internal static event Action OnArmatureLockUpdate;
|
|
internal static event Action OnMoveIndependentlyUpdate;
|
|
|
|
#if UNITY_EDITOR
|
|
[UnityEditor.InitializeOnLoadMethod]
|
|
private static void Init()
|
|
{
|
|
UnityEditor.EditorApplication.update += () =>
|
|
{
|
|
if (ArmatureLockConfig.instance.GlobalEnable)
|
|
{
|
|
OnArmatureLockPrepare?.Invoke();
|
|
OnArmatureLockUpdate?.Invoke();
|
|
}
|
|
|
|
OnMoveIndependentlyUpdate?.Invoke();
|
|
};
|
|
}
|
|
#endif
|
|
|
|
internal static void InvokeArmatureLockPrepare()
|
|
{
|
|
OnArmatureLockPrepare?.Invoke();
|
|
}
|
|
}
|
|
} |