modular-avatar/Runtime/ArmatureAwase/UpdateLoopController.cs
bd_ f6ac07e1cd
opti: perf improvements for armature lock (#714)
* opti: perf improvements for armature lock

* chore: unity 2019 compatibility

* chore: update comments
2024-03-03 17:34:48 +09:00

37 lines
813 B
C#

#region
using System;
using System.Collections.Generic;
using Unity.Jobs;
using UnityEditor;
#endregion
namespace nadena.dev.modular_avatar.core.armature_lock
{
internal static class UpdateLoopController
{
internal static event Action UpdateCallbacks;
internal static event Action OnMoveIndependentlyUpdate;
#if UNITY_EDITOR
[InitializeOnLoadMethod]
private static void Init()
{
EditorApplication.update += Update;
}
private static List<JobHandle> jobs = new List<JobHandle>();
private static void Update()
{
if (ArmatureLockConfig.instance.GlobalEnable)
{
UpdateCallbacks?.Invoke();
}
OnMoveIndependentlyUpdate?.Invoke();
}
#endif
}
}