Files
stas-barecky/Library/PackageCache/com.unity.2d.animation@3c53dae92956/Runtime/BatchedDeformation/DeformationManagerUpdater.cs
2026-01-08 20:43:08 +05:00

30 lines
853 B
C#

using Unity.Profiling;
namespace UnityEngine.U2D.Animation
{
[AddComponentMenu("")]
[DefaultExecutionOrder(UpdateOrder.spriteSkinUpdateOrder)]
[ExecuteInEditMode]
internal class DeformationManagerUpdater : MonoBehaviour
{
public System.Action<GameObject> onDestroyingComponent { get; set; }
ProfilerMarker m_ProfilerMarker = new ProfilerMarker("DeformationManager.LateUpdate");
void OnDestroy() => onDestroyingComponent?.Invoke(gameObject);
void LateUpdate()
{
if (DeformationManager.instance.helperGameObject != gameObject)
{
GameObject.DestroyImmediate(gameObject);
return;
}
m_ProfilerMarker.Begin();
DeformationManager.instance.Update();
m_ProfilerMarker.End();
}
}
}