No Description
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.

SpriteResolverEditor.cs 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #if UNITY_EDITOR
  2. using System;
  3. using UnityEditor;
  4. namespace UnityEngine.U2D.Animation
  5. {
  6. public partial class SpriteResolver : ISerializationCallbackReceiver
  7. {
  8. internal static string spriteHashPropertyName => nameof(m_SpriteHash);
  9. bool m_SpriteLibChanged;
  10. /// <summary>
  11. /// Raised when object is deserialized in the Editor.
  12. /// </summary>
  13. public event Action onDeserializedCallback = () => { };
  14. void OnDidApplyAnimationProperties()
  15. {
  16. if (IsInGUIUpdateLoop())
  17. ResolveUpdatedValue();
  18. }
  19. internal bool spriteLibChanged
  20. {
  21. get => m_SpriteLibChanged;
  22. set => m_SpriteLibChanged = value;
  23. }
  24. /// <summary>
  25. /// Called before object is serialized.
  26. /// </summary>
  27. void ISerializationCallbackReceiver.OnBeforeSerialize() { }
  28. /// <summary>
  29. /// Called after object is deserialized.
  30. /// </summary>
  31. void ISerializationCallbackReceiver.OnAfterDeserialize()
  32. {
  33. onDeserializedCallback();
  34. }
  35. }
  36. }
  37. #endif