// Animancer // https://kybernetik.com.au/animancer // Copyright 2018-2023 Kybernetik // using System; namespace Animancer { /// Determines how works. /// /// Documentation: Fade Modes /// /// Example: Transitions /// /// https://kybernetik.com.au/animancer/api/Animancer/FadeMode /// public enum FadeMode { /************************************************************************************************************************/ /// /// Calculate the fade speed to bring the from 0 to 1 over the specified /// fade duration (in seconds), regardless of the actual starting weight. /// /// /// /// A fade duration of 0.5 would make the fade last for 0.5 seconds, regardless of how long the animation is. /// /// This is generally the same as but differs when starting the fade from a /// non-zero , for example: /// /// Fade Duration: 0.25 /// To fade from 0 to 1 with either mode would get a speed of 4 and take 0.25 seconds /// To fade from 0.5 to 1 with would get a speed of 2 and take 0.25 seconds. /// It has half the distance to cover so it goes half as fast to maintain the expected duration. /// To fade from 0.5 to 1 with would get a speed of 4 and take 0.125 seconds. /// It gets the same speed regardless of the distance to cover, so with less distance it completes faster. /// /// /// /// The is null. /// /// /// More states have been created for the than the /// allows. /// FixedSpeed, /// /// Calculate the fade speed to bring the to the target value over the /// specified fade duration (in seconds). /// /// /// /// A fade duration of 0.5 would make the fade last for 0.5 seconds, regardless of how long the animation is. /// /// This is generally the same as , but differs when starting the fade from a /// non-zero : /// /// Fade Duration: 0.25 /// To fade from 0 to 1 with either mode would get a speed of 4 and take 0.25 seconds /// To fade from 0.5 to 1 with would get a speed of 2 and take 0.25 seconds. /// It has half the distance to cover so it goes half as fast to maintain the expected duration. /// To fade from 0.5 to 1 with would get a speed of 4 and take 0.125 seconds. /// It gets the same speed regardless of the distance to cover, so with less distance it completes faster. /// /// /// /// /// This was how fading worked prior to the introduction of s in Animancer v4.0. /// FixedDuration, /// /// If the is above the , /// this mode will use to get a copy of it that is at 0 /// weight so it can fade the copy in while the original fades out with all other states. This allows an /// animation to fade into itself. /// /// /// /// This mode can be useful when you want to repeat an action while the previous animation is still fading out. /// For example, if you play an 'Attack' animation, it ends and starts fading back to 'Idle', and while it is /// doing so you want to start another 'Attack' with the same animation. The previous 'Attack' can't simply /// snap back to the start, so you can use this mode to create a second 'Attack' state to fade in while the old /// one fades out. /// /// /// /// Using this mode repeatedly on subsequent frames will probably have undesirable effects because it will /// create a new state each time. In such a situation you most likely want instead. /// /// This mode only works for s. /// /// The Fade Modes page /// explains this mode in more detail. /// FromStart, /// /// Like , except that the fade duration is multiplied by the animation length. /// NormalizedSpeed, /// /// Like , except that the fade duration is multiplied by the animation length. /// NormalizedDuration, /// /// Like , except that the fade duration is multiplied by the animation length. /// NormalizedFromStart, /************************************************************************************************************************/ } }