Archived
Private
Public Access
1
0
This repository has been archived on 2026-02-04. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
ProjectBackup/Unity/NeuralNetwork/Library/PackageCache/com.unity.2d.animation@7.0.9/Runtime/SpriteSkinUpdateHelper.cs
2023-07-31 21:20:56 +02:00

36 lines
970 B
C#

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
}
}
}