2023-09-27 19:24:42 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace nadena.dev.modular_avatar.core.armature_lock
|
|
|
|
|
{
|
|
|
|
|
internal static class UpdateLoopController
|
|
|
|
|
{
|
2024-02-17 18:20:08 +08:00
|
|
|
|
internal static event Action OnArmatureLockPrepare;
|
2023-09-27 19:24:42 +08:00
|
|
|
|
internal static event Action OnArmatureLockUpdate;
|
|
|
|
|
internal static event Action OnMoveIndependentlyUpdate;
|
|
|
|
|
|
|
|
|
|
#if UNITY_EDITOR
|
|
|
|
|
[UnityEditor.InitializeOnLoadMethod]
|
|
|
|
|
private static void Init()
|
|
|
|
|
{
|
|
|
|
|
UnityEditor.EditorApplication.update += () =>
|
|
|
|
|
{
|
2024-02-17 18:20:08 +08:00
|
|
|
|
if (ArmatureLockConfig.instance.GlobalEnable)
|
|
|
|
|
{
|
|
|
|
|
OnArmatureLockPrepare?.Invoke();
|
|
|
|
|
OnArmatureLockUpdate?.Invoke();
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-27 19:24:42 +08:00
|
|
|
|
OnMoveIndependentlyUpdate?.Invoke();
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
#endif
|
2024-02-17 18:20:08 +08:00
|
|
|
|
|
|
|
|
|
internal static void InvokeArmatureLockPrepare()
|
|
|
|
|
{
|
|
|
|
|
OnArmatureLockPrepare?.Invoke();
|
|
|
|
|
}
|
2023-09-27 19:24:42 +08:00
|
|
|
|
}
|
|
|
|
|
}
|