Ejemplo n.º 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));
            }
        }
Ejemplo n.º 2
0
 protected override void DownAction()
 {
     if (PressedAnimation != null)
     {
         PressedAnimation.Stop();
         PressedAnimation.Play();
     }
 }
Ejemplo n.º 3
0
 private void RunSwitchAnimation()
 {
     if (SwitchValue)
     {
         SwitchAnimation.Stop();
         SwitchAnimation.Play();
     }
     else
     {
         SwitchAnimation.Stop();
         SwitchAnimation.Reverse();
     }
 }
Ejemplo n.º 4
0
 protected override void UpAction()
 {
     if (ReleasedAnimation != null)
     {
         ReleasedAnimation.Stop();
         ReleasedAnimation.Play();
     }
     else if (PressedAnimation != null)
     {
         PressedAnimation.Stop();
         PressedAnimation.Reverse();
     }
 }
Ejemplo n.º 5
0
        protected override void DisableAction()
        {
            base.DisableAction();

            //Parando as demais animações
            if (PressedAnimation != null)
            {
                PressedAnimation.Stop();
            }

            if (ReleasedAnimation != null)
            {
                ReleasedAnimation.Stop();
            }

            if (DisabledAnimation != null)
            {
                DisabledAnimation.Play();
            }
        }