mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-01-01 20:25:07 +08:00
f6ac07e1cd
* opti: perf improvements for armature lock * chore: unity 2019 compatibility * chore: update comments
37 lines
813 B
C#
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
|
|
}
|
|
} |