// Animancer // Copyright 2020 Kybernetik // namespace Animancer { /// /// An object that can create an and manage the details of how it should be played. /// /// Transitions are generally used as arguments for . /// public interface ITransition : IHasKey { /************************************************************************************************************************/ /// /// Creates and returns a new connected to the `layer`. /// /// /// The first time a transition is used on an object, this method is called to create the state and register it /// in the internal dictionary using the so that it can be reused later on. /// AnimancerState CreateState(AnimancerLayer layer); /// /// When a transition is passed into , this property /// determines which will be used. /// FadeMode FadeMode { get; } /// The amount of time the transition should take (in seconds). float FadeDuration { get; } /// /// Called by to apply any modifications to the `state`. /// /// /// Unlike , this method is called every time the transition is used so it can do /// things like set the or . /// void Apply(AnimancerState state); /************************************************************************************************************************/ } /// /// An with some additional details for the Unity Editor GUI. /// public interface ITransitionDetailed : ITransition { /************************************************************************************************************************/ /// Indicates what the value of will be for the created state. bool IsLooping { get; } /// Determines what to start the animation at. float NormalizedStartTime { get; set; } /// Determines how fast the animation plays (1x = normal speed). float Speed { get; set; } /// The maximum amount of time the animation is expected to take (in seconds). float MaximumDuration { get; } #if UNITY_EDITOR /// [Editor-Only] Adds context menu functions for this transition. void AddItemsToContextMenu(UnityEditor.GenericMenu menu, UnityEditor.SerializedProperty property, Editor.Serialization.PropertyAccessor accessor); #endif /************************************************************************************************************************/ } }