Esempio n. 1
0
        public void Toggle(bool _activate, bool _animateClick = false)
        {
            IsToggled = _activate;

            pulseTween.Rewind();
            BtImg.color = _activate ? DefColor : IsLocked ? BtLockedColor : BtToggleOffColor;
            if (ToggleIconAlpha && Ico != null)
            {
                Ico.SetAlpha(_activate ? 1 : 0.4f);
            }

            if (_animateClick)
            {
                AnimateClick(true);
            }
        }
Esempio n. 2
0
        public virtual void Toggle(bool _activate, bool _animateClick = false)
        {
            IsToggled = _activate;

            if (pulseTween != null && pulseTween.Elapsed() > 0)
            {
                pulseTween.Rewind();
            }
            BtImg.color = _activate ? DefaultColor : IsLocked ? BtLockedColor : BtToggleOffColor;
            if (ToggleIconAlpha && Ico != null)
            {
                Ico.SetAlpha(_activate ? 1 : 0.4f);
            }
            if (ToggleCanvasGroupAlpha)
            {
                CGroup.alpha = _activate ? 1 : 0.4f;
            }

            if (_animateClick)
            {
                AnimateClick(true);
            }
        }