Singularity/Library/PackageCache/com.unity.2d.animation@7.0.10/Runtime/SpriteSkinUpdateHelper.cs

36 lines
970 B
C#
Raw Permalink Normal View History

2024-05-06 14:45:45 -04:00
using Unity.Profiling;
namespace UnityEngine.U2D.Animation
{
[AddComponentMenu("")]
[DefaultExecutionOrder(-1)]
[ExecuteInEditMode]
internal class SpriteSkinUpdateHelper : MonoBehaviour
{
public System.Action<GameObject> onDestroyingComponent
{
get;
set;
}
ProfilerMarker m_ProfilerMarker = new ProfilerMarker("SpriteSkinUpdateHelper.LateUpdate");
void OnDestroy() => onDestroyingComponent?.Invoke(gameObject);
void LateUpdate()
{
#if ENABLE_ANIMATION_BURST && ENABLE_ANIMATION_COLLECTION
if (SpriteSkinComposite.instance.helperGameObject != gameObject)
{
GameObject.DestroyImmediate(gameObject);
return;
}
m_ProfilerMarker.Begin();
SpriteSkinComposite.instance.LateUpdate();
m_ProfilerMarker.End();
#endif
}
}
}