// Animancer // https://kybernetik.com.au/animancer // Copyright 2018-2024 Kybernetik // namespace Animancer.Units { /// [Editor-Conditional] /// Causes a float field to display using 3 fields: Normalized, Seconds, and Frames. /// /// /// Documentation: /// /// Time Fields /// /// https://kybernetik.com.au/animancer/api/Animancer.Units/AnimationTimeAttribute /// [System.Diagnostics.Conditional(Strings.UnityEditor)] public sealed class AnimationTimeAttribute : UnitsAttribute { /************************************************************************************************************************/ /// A unit of measurement used by the . public enum Units { /// A value of 1 represents the end of the animation. Normalized = 0, /// A value of 1 represents 1 second. Seconds = 1, /// A value of 1 represents 1 frame. Frames = 2, } /// An explanation of the suffixes used in fields drawn by this attribute. public const string Tooltip = "x = Normalized, s = Seconds, f = Frames"; /// The used by instances of this attribute. private static new readonly float[] Multipliers = new float[3];// Calculated immediately before each use. /// The used by instances of this attribute. private static new readonly string[] Suffixes = new string[3] { "x", "s", "f" }; /************************************************************************************************************************/ /// Cretes a new . public AnimationTimeAttribute(Units units) : base(Multipliers, Suffixes, (int)units) { } /************************************************************************************************************************/ } }