WeightedMaskLayersFadeDrawer.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Animancer // https://kybernetik.com.au/animancer // Copyright 2018-2024 Kybernetik //
  2. #if UNITY_EDITOR
  3. using UnityEditor;
  4. namespace Animancer.Editor
  5. {
  6. /// <summary>[Editor-Only] A custom GUI for <see cref="WeightedMaskLayers.Fade"/>.</summary>
  7. /// https://kybernetik.com.au/animancer/api/Animancer.Editor/WeightedMaskLayersFadeDrawer
  8. [CustomGUI(typeof(WeightedMaskLayers.Fade))]
  9. public class WeightedMaskLayersFadeDrawer : CustomGUI<WeightedMaskLayers.Fade>
  10. {
  11. /************************************************************************************************************************/
  12. private bool _IsExpanded;
  13. /************************************************************************************************************************/
  14. /// <inheritdoc/>
  15. public override void DoGUI()
  16. {
  17. _IsExpanded = EditorGUILayout.Foldout(_IsExpanded, "Weighted Mask Layers Fade", true);
  18. if (_IsExpanded)
  19. DoDetailsGUI();
  20. }
  21. /************************************************************************************************************************/
  22. /// <summary>Draws the GUI for the target's fields.</summary>
  23. protected virtual void DoDetailsGUI()
  24. {
  25. EditorGUI.indentLevel++;
  26. Value.ElapsedTime = EditorGUILayout.Slider("Elapsed", Value.ElapsedTime, 0, Value.Duration);
  27. Value.Duration = EditorGUILayout.FloatField("Duration", Value.Duration);
  28. EditorGUI.indentLevel--;
  29. }
  30. /************************************************************************************************************************/
  31. }
  32. }
  33. #endif