SkinningEvents.cs 4.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. using System;
  2. using UnityEngine;
  3. using UnityEngine.Events;
  4. namespace UnityEditor.U2D.Animation
  5. {
  6. internal class SkinningEvents
  7. {
  8. public class SpriteEvent : UnityEvent<SpriteCache> {}
  9. public class SkeletonEvent : UnityEvent<SkeletonCache> {}
  10. public class MeshEvent : UnityEvent<MeshCache> {}
  11. public class MeshPreviewEvent : UnityEvent<MeshPreviewCache> {}
  12. public class SkinningModuleModeEvent : UnityEvent<SkinningMode> {}
  13. public class BoneSelectionEvent : UnityEvent {}
  14. public class BoneEvent : UnityEvent<BoneCache> {}
  15. public class CharacterPartEvent : UnityEvent<CharacterPartCache> {}
  16. public class ToolChangeEvent : UnityEvent<ITool> {}
  17. public class RestoreBindPoseEvent : UnityEvent {}
  18. public class CopyEvent : UnityEvent {}
  19. public class PasteEvent : UnityEvent<bool, bool, bool, bool> {}
  20. public class ShortcutEvent : UnityEvent<string> {}
  21. public class BoneVisibilityEvent : UnityEvent<string> {}
  22. public class SpriteLibraryEvent : UnityEvent {}
  23. public class MeshPreviewBehaviourChangeEvent : UnityEvent<IMeshPreviewBehaviour> {}
  24. private SpriteEvent m_SelectedSpriteChanged = new SpriteEvent();
  25. private SkeletonEvent m_SkeletonPreviewPoseChanged = new SkeletonEvent();
  26. private SkeletonEvent m_SkeletonBindPoseChanged = new SkeletonEvent();
  27. private SkeletonEvent m_SkeletonTopologyChanged = new SkeletonEvent();
  28. private MeshEvent m_MeshChanged = new MeshEvent();
  29. private MeshPreviewEvent m_MeshPreviewChanged = new MeshPreviewEvent();
  30. private SkinningModuleModeEvent m_SkinningModuleModeChanged = new SkinningModuleModeEvent();
  31. private BoneSelectionEvent m_BoneSelectionChangedEvent = new BoneSelectionEvent();
  32. private BoneEvent m_BoneNameChangedEvent = new BoneEvent();
  33. private BoneEvent m_BoneDepthChangedEvent = new BoneEvent();
  34. private CharacterPartEvent m_CharacterPartChanged = new CharacterPartEvent();
  35. private ToolChangeEvent m_ToolChanged = new ToolChangeEvent();
  36. private RestoreBindPoseEvent m_RestoreBindPose = new RestoreBindPoseEvent();
  37. private CopyEvent m_CopyEvent = new CopyEvent();
  38. private PasteEvent m_PasteEvent = new PasteEvent();
  39. private ShortcutEvent m_ShortcutEvent = new ShortcutEvent();
  40. private BoneVisibilityEvent m_BoneVisibilityEvent = new BoneVisibilityEvent();
  41. private SpriteLibraryEvent m_SpriteLibraryEvent = new SpriteLibraryEvent();
  42. private MeshPreviewBehaviourChangeEvent m_MeshPreviewBehaviourChange = new MeshPreviewBehaviourChangeEvent();
  43. //Setting them as virtual so that we can create mock them
  44. public virtual SpriteEvent selectedSpriteChanged { get { return m_SelectedSpriteChanged; } }
  45. public virtual SkeletonEvent skeletonPreviewPoseChanged { get { return m_SkeletonPreviewPoseChanged; } }
  46. public virtual SkeletonEvent skeletonBindPoseChanged { get { return m_SkeletonBindPoseChanged; } }
  47. public virtual SkeletonEvent skeletonTopologyChanged { get { return m_SkeletonTopologyChanged; } }
  48. public virtual MeshEvent meshChanged { get { return m_MeshChanged; } }
  49. public virtual MeshPreviewEvent meshPreviewChanged { get { return m_MeshPreviewChanged; } }
  50. public virtual SkinningModuleModeEvent skinningModeChanged { get { return m_SkinningModuleModeChanged; } }
  51. public virtual BoneSelectionEvent boneSelectionChanged { get { return m_BoneSelectionChangedEvent; } }
  52. public virtual BoneEvent boneNameChanged { get { return m_BoneNameChangedEvent; } }
  53. public virtual BoneEvent boneDepthChanged { get { return m_BoneDepthChangedEvent; } }
  54. public virtual CharacterPartEvent characterPartChanged { get { return m_CharacterPartChanged; } }
  55. public virtual ToolChangeEvent toolChanged { get { return m_ToolChanged; } }
  56. public virtual RestoreBindPoseEvent restoreBindPose { get { return m_RestoreBindPose; } }
  57. public virtual CopyEvent copy { get { return m_CopyEvent; } }
  58. public virtual PasteEvent paste { get { return m_PasteEvent; } }
  59. public virtual ShortcutEvent shortcut { get { return m_ShortcutEvent; } }
  60. public virtual BoneVisibilityEvent boneVisibility { get { return m_BoneVisibilityEvent; } }
  61. public virtual SpriteLibraryEvent spriteLibraryChanged { get { return m_SpriteLibraryEvent; } }
  62. public virtual MeshPreviewBehaviourChangeEvent meshPreviewBehaviourChange { get { return m_MeshPreviewBehaviourChange; } }
  63. }
  64. }