Exemple #1
0
        public void UpdateOwnLogic()
        {
            if (_animator.AnimationFinished)
            {
                if (_state == ButtonStates.Disabled || _state == ButtonStates.Enabled || _state == ButtonStates.Selected ||
                    _state == ButtonStates.HighlightDisabled || _state == ButtonStates.HighlightEnabled || _state == ButtonStates.HighlightSelected)
                {
                    _animator.AdvanceAnimationReplay();
                    return;
                }

                if (_state == ButtonStates.Select)
                {
                    if (_type == ButtonType.Standard)
                    {
                        _state = ButtonStates.Enabled;
                        _animator.SetNewAnimation((int)ButtonStates.Enabled);
                    }
                    else
                    {
                        _state = ButtonStates.Selected;
                        _animator.SetNewAnimation((int)ButtonStates.Selected);
                    }
                }

                if (_state == ButtonStates.Deselect || _state == ButtonStates.FadeIn)
                {
                    _state = ButtonStates.Enabled;
                    _animator.SetNewAnimation((int)ButtonStates.Enabled);
                }

                if (_state == ButtonStates.FadeOut)
                {
                    _state = ButtonStates.Hidden;
                }
            }
            else
            {
                _animator.AdvanceAnimation();
            }
        }