You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
893 B
34 lines
893 B
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 (SpriteSkinComposite.instance.helperGameObject != gameObject)
|
|
{
|
|
GameObject.DestroyImmediate(gameObject);
|
|
return;
|
|
}
|
|
|
|
m_ProfilerMarker.Begin();
|
|
SpriteSkinComposite.instance.LateUpdate();
|
|
m_ProfilerMarker.End();
|
|
}
|
|
}
|
|
}
|