AnimationSpeedAttributeDrawer.cs 1.0 KB

1234567891011121314151617181920212223242526272829
  1. // Animancer // https://kybernetik.com.au/animancer // Copyright 2018-2024 Kybernetik //
  2. #if UNITY_EDITOR && UNITY_IMGUI
  3. using UnityEditor;
  4. using UnityEngine;
  5. namespace Animancer.Units.Editor
  6. {
  7. /// <summary>[Editor-Only]
  8. /// A <see cref="PropertyDrawer"/> for fields with an <see cref="AnimationSpeedAttributeDrawer"/>
  9. /// which displays them using an 'x' suffix.
  10. /// </summary>
  11. /// https://kybernetik.com.au/animancer/api/Animancer.Units.Editor/AnimationSpeedAttributeDrawer
  12. [CustomPropertyDrawer(typeof(AnimationSpeedAttribute), true)]
  13. public class AnimationSpeedAttributeDrawer : UnitsAttributeDrawer
  14. {
  15. /************************************************************************************************************************/
  16. /// <inheritdoc/>
  17. protected override int GetLineCount(SerializedProperty property, GUIContent label)
  18. => 1;
  19. /************************************************************************************************************************/
  20. }
  21. }
  22. #endif