using System; using UnityEngine.Serialization; namespace UnityEngine.UI { /// /// Structure that stores the state of an animation transition on a Selectable. /// [Serializable] public class AnimationTriggers { private const string kDefaultNormalAnimName = "Normal"; private const string kDefaultHighlightedAnimName = "Highlighted"; private const string kDefaultPressedAnimName = "Pressed"; private const string kDefaultSelectedAnimName = "Selected"; private const string kDefaultDisabledAnimName = "Disabled"; [FormerlySerializedAs("normalTrigger")] [SerializeField] private string m_NormalTrigger = kDefaultNormalAnimName; [FormerlySerializedAs("highlightedTrigger")] [SerializeField] private string m_HighlightedTrigger = kDefaultHighlightedAnimName; [FormerlySerializedAs("pressedTrigger")] [SerializeField] private string m_PressedTrigger = kDefaultPressedAnimName; [FormerlySerializedAs("m_HighlightedTrigger")] [SerializeField] private string m_SelectedTrigger = kDefaultSelectedAnimName; [FormerlySerializedAs("disabledTrigger")] [SerializeField] private string m_DisabledTrigger = kDefaultDisabledAnimName; /// /// Trigger to send to animator when entering normal state. /// /// /// /// /// /// public string normalTrigger { get { return m_NormalTrigger; } set { m_NormalTrigger = value; } } /// /// Trigger to send to animator when entering highlighted state. /// /// /// /// /// /// public string highlightedTrigger { get { return m_HighlightedTrigger; } set { m_HighlightedTrigger = value; } } /// /// Trigger to send to animator when entering pressed state. /// /// /// /// /// /// public string pressedTrigger { get { return m_PressedTrigger; } set { m_PressedTrigger = value; } } /// /// Trigger to send to animator when entering selected state. /// /// /// /// /// /// public string selectedTrigger { get { return m_SelectedTrigger; } set { m_SelectedTrigger = value; } } /// /// Trigger to send to animator when entering disabled state. /// /// /// /// /// /// public string disabledTrigger { get { return m_DisabledTrigger; } set { m_DisabledTrigger = value; } } } }