SwitchModeTool.cs 731 B

12345678910111213141516171819202122232425
  1. using System;
  2. namespace UnityEditor.U2D.Animation
  3. {
  4. internal class SwitchModeTool : BaseTool
  5. {
  6. protected override void OnActivate()
  7. {
  8. if (skinningCache.mode != SkinningMode.SpriteSheet)
  9. {
  10. skinningCache.mode = SkinningMode.SpriteSheet;
  11. skinningCache.events.skinningModeChanged.Invoke(SkinningMode.SpriteSheet);
  12. }
  13. }
  14. protected override void OnDeactivate()
  15. {
  16. if (skinningCache.mode != SkinningMode.Character)
  17. {
  18. skinningCache.mode = SkinningMode.Character;
  19. skinningCache.events.skinningModeChanged.Invoke(SkinningMode.Character);
  20. }
  21. }
  22. }
  23. }