Beispiel #1
0
        void UpdateToggleSprite()
        {
            if (_isChecked)
            {
                ToggleSprite.SetActive(true);
            }
            else if (_toggleSpriteAnim == null)
            {
                ToggleSprite.SetActive(false);
            }

            if (_toggleSpriteAnim == null)
            {
                return;
            }

            if (_isChecked)
            {
                _toggleSpriteAnim.Play();
            }
            else
            {
                _toggleSpriteAnim.Reverse(() => ToggleSprite.SetActive(false));
            }
        }
Beispiel #2
0
        protected override void EnableAction()
        {
            base.EnableAction();

            if (DisabledAnimation != null)
            {
                DisabledAnimation.Reverse();
            }
        }
Beispiel #3
0
 private void RunSwitchAnimation()
 {
     if (SwitchValue)
     {
         SwitchAnimation.Stop();
         SwitchAnimation.Play();
     }
     else
     {
         SwitchAnimation.Stop();
         SwitchAnimation.Reverse();
     }
 }
Beispiel #4
0
 protected override void UpAction()
 {
     if (ReleasedAnimation != null)
     {
         ReleasedAnimation.Stop();
         ReleasedAnimation.Play();
     }
     else if (PressedAnimation != null)
     {
         PressedAnimation.Stop();
         PressedAnimation.Reverse();
     }
 }