2024-03-03 16:34:48 +08:00
|
|
|
|
#region
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using Unity.Jobs;
|
|
|
|
|
using UnityEditor;
|
|
|
|
|
|
|
|
|
|
#endregion
|
2023-09-27 19:24:42 +08:00
|
|
|
|
|
|
|
|
|
namespace nadena.dev.modular_avatar.core.armature_lock
|
|
|
|
|
{
|
|
|
|
|
internal static class UpdateLoopController
|
|
|
|
|
{
|
2024-03-03 16:34:48 +08:00
|
|
|
|
internal static event Action UpdateCallbacks;
|
2023-09-27 19:24:42 +08:00
|
|
|
|
internal static event Action OnMoveIndependentlyUpdate;
|
|
|
|
|
|
|
|
|
|
#if UNITY_EDITOR
|
2024-03-03 16:34:48 +08:00
|
|
|
|
[InitializeOnLoadMethod]
|
2023-09-27 19:24:42 +08:00
|
|
|
|
private static void Init()
|
|
|
|
|
{
|
2024-03-03 16:34:48 +08:00
|
|
|
|
EditorApplication.update += Update;
|
2023-09-27 19:24:42 +08:00
|
|
|
|
}
|
2024-02-17 18:20:08 +08:00
|
|
|
|
|
2024-03-03 16:34:48 +08:00
|
|
|
|
private static List<JobHandle> jobs = new List<JobHandle>();
|
|
|
|
|
|
|
|
|
|
private static void Update()
|
2024-02-17 18:20:08 +08:00
|
|
|
|
{
|
2024-03-03 16:34:48 +08:00
|
|
|
|
if (ArmatureLockConfig.instance.GlobalEnable)
|
|
|
|
|
{
|
|
|
|
|
UpdateCallbacks?.Invoke();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
OnMoveIndependentlyUpdate?.Invoke();
|
2024-02-17 18:20:08 +08:00
|
|
|
|
}
|
2024-03-03 16:34:48 +08:00
|
|
|
|
#endif
|
2023-09-27 19:24:42 +08:00
|
|
|
|
}
|
|
|
|
|
}
|