DefaultFadeValueAttribute.cs 1.2 KB

1234567891011121314151617181920212223242526272829
  1. // Animancer // https://kybernetik.com.au/animancer // Copyright 2018-2024 Kybernetik //
  2. namespace Animancer
  3. {
  4. /// <summary>[Editor-Conditional]
  5. /// A <see cref="DefaultValueAttribute"/> which uses the <see cref="AnimancerGraph.DefaultFadeDuration"/> and 0.
  6. /// </summary>
  7. /// https://kybernetik.com.au/animancer/api/Animancer/DefaultFadeValueAttribute
  8. ///
  9. public class DefaultFadeValueAttribute : DefaultValueAttribute
  10. {
  11. /************************************************************************************************************************/
  12. /// <inheritdoc/>
  13. public override object Primary => AnimancerGraph.DefaultFadeDuration;
  14. /************************************************************************************************************************/
  15. /// <summary>Creates a new <see cref="DefaultValueAttribute"/>.</summary>
  16. public DefaultFadeValueAttribute()
  17. {
  18. // This won't change so there's no need to box the value every time by overriding the property.
  19. Secondary = 0f;
  20. }
  21. /************************************************************************************************************************/
  22. }
  23. }