ITransitionGUI.cs 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // Animancer // https://kybernetik.com.au/animancer // Copyright 2018-2024 Kybernetik //
  2. #if UNITY_EDITOR
  3. using UnityEngine;
  4. namespace Animancer.Editor
  5. {
  6. /// <summary>[Editor-Only] An object that can draw custom GUI elements relating to transitions.</summary>
  7. /// https://kybernetik.com.au/animancer/api/Animancer.Editor/ITransitionGUI
  8. public interface ITransitionGUI
  9. {
  10. /************************************************************************************************************************/
  11. /// <summary>Called while drawing the GUI for the <see cref="Previews.TransitionPreviewWindow"/> scene.</summary>
  12. void OnPreviewSceneGUI(TransitionPreviewDetails details);
  13. /// <summary>
  14. /// Called while drawing the background GUI for the <see cref="TimelineGUI"/> for the
  15. /// <see cref="IHasEvents.Events"/>.
  16. /// </summary>
  17. void OnTimelineBackgroundGUI();
  18. /// <summary>
  19. /// Called while drawing the foreground GUI for the <see cref="TimelineGUI"/> for the
  20. /// <see cref="IHasEvents.Events"/>.
  21. /// </summary>
  22. void OnTimelineForegroundGUI();
  23. /************************************************************************************************************************/
  24. }
  25. /// <summary>[Editor-Only] Details about the current preview used by <see cref="ITransitionGUI.OnPreviewSceneGUI"/>.</summary>
  26. /// https://kybernetik.com.au/animancer/api/Animancer.Editor/TransitionPreviewDetails
  27. public readonly struct TransitionPreviewDetails
  28. {
  29. /************************************************************************************************************************/
  30. /// <summary>The <see cref="AnimancerGraph"/> used to play the preview.</summary>
  31. public readonly AnimancerGraph Animancer;
  32. /// <summary>The <see cref="UnityEngine.Transform"/> of the <see cref="Animator"/> used to play the preview.</summary>
  33. public Transform Transform => Animancer.Component.Animator.transform;
  34. /************************************************************************************************************************/
  35. /// <summary>Creates a new <see cref="TransitionPreviewDetails"/>.</summary>
  36. public TransitionPreviewDetails(AnimancerGraph animancer)
  37. {
  38. Animancer = animancer;
  39. }
  40. /************************************************************************************************************************/
  41. }
  42. }
  43. #endif