modular-avatar/Runtime/ArmatureAwase/UpdateLoopController.cs
bd_ 648c9a9608
feat: improvements to armature tracking (#665)
* 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
2024-02-17 19:20:08 +09:00

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();
}
}
}