UnityEngine.UI.Selectable.DoStateTransition C# (CSharp) Method

DoStateTransition() protected method

protected DoStateTransition ( SelectionState state, bool instant ) : void
state SelectionState
instant bool
return void
        protected virtual void DoStateTransition(SelectionState state, bool instant)
        {
            Color normalColor;
            Sprite highlightedSprite;
            string normalTrigger;
            switch (state)
            {
                case SelectionState.Normal:
                    normalColor = this.m_Colors.normalColor;
                    highlightedSprite = null;
                    normalTrigger = this.m_AnimationTriggers.normalTrigger;
                    break;

                case SelectionState.Highlighted:
                    normalColor = this.m_Colors.highlightedColor;
                    highlightedSprite = this.m_SpriteState.highlightedSprite;
                    normalTrigger = this.m_AnimationTriggers.highlightedTrigger;
                    break;

                case SelectionState.Pressed:
                    normalColor = this.m_Colors.pressedColor;
                    highlightedSprite = this.m_SpriteState.pressedSprite;
                    normalTrigger = this.m_AnimationTriggers.pressedTrigger;
                    break;

                case SelectionState.Disabled:
                    normalColor = this.m_Colors.disabledColor;
                    highlightedSprite = this.m_SpriteState.disabledSprite;
                    normalTrigger = this.m_AnimationTriggers.disabledTrigger;
                    break;

                default:
                    normalColor = Color.black;
                    highlightedSprite = null;
                    normalTrigger = string.Empty;
                    break;
            }
            if (base.gameObject.activeInHierarchy)
            {
                switch (this.m_Transition)
                {
                    case Transition.ColorTint:
                        this.StartColorTween((Color) (normalColor * this.m_Colors.colorMultiplier), instant);
                        break;

                    case Transition.SpriteSwap:
                        this.DoSpriteSwap(highlightedSprite);
                        break;

                    case Transition.Animation:
                        this.TriggerAnimation(normalTrigger);
                        break;
                }
            }
        }