public virtual void OnPointerEnter(PointerEventData eventData)
        {
            if (fadeTweener.IsRunning)
            {
                fadeTweener.CompleteInstantly();
            }
            var tween = new FloatTween(CurrentOpacity, 1f, FadeTime, SetOpacity, true);

            fadeTweener.Run(tween);
        }
Exemple #2
0
        protected virtual void FadeInSlot()
        {
            if (fadeTweener.Running)
            {
                fadeTweener.CompleteInstantly();
            }
            var tween = new FloatTween(Opacity, 1f, FadeTime, SetOpacity, true, target: this);

            fadeTweener.Run(tween);
        }
        public void FadeVolume(float volume, float time)
        {
            if (listenerVolumeTweener.IsRunning)
            {
                listenerVolumeTweener.CompleteInstantly();
            }

            var tween = new FloatTween(Volume, volume, time, value => Volume = value, ignoreTimeScale: true);

            listenerVolumeTweener.Run(tween);
        }
 private void CompleteAllRunners()
 {
     if (volumeTweener.IsRunning)
     {
         volumeTweener.CompleteInstantly();
     }
     if (stopTimer.IsRunning)
     {
         stopTimer.CompleteInstantly();
     }
 }
Exemple #5
0
        protected override void DoStateTransition(SelectionState state, bool instant)
        {
            base.DoStateTransition(state, instant);

            if (!Label)
            {
                return;
            }

            Color tintColor;

            switch (state)
            {
            case SelectionState.Normal:
                tintColor = LabelColorBlock.normalColor;
                break;

            case SelectionState.Highlighted:
                tintColor = LabelColorBlock.highlightedColor;
                break;

            case SelectionState.Pressed:
                tintColor = LabelColorBlock.pressedColor;
                break;

            case SelectionState.Selected:
                tintColor = LabelColorBlock.selectedColor;
                break;

            case SelectionState.Disabled:
                tintColor = LabelColorBlock.disabledColor;
                break;

            default:
                tintColor = Color.white;
                break;
            }

            if (instant)
            {
                if (tintTweener != null && tintTweener.IsRunning)
                {
                    tintTweener.CompleteInstantly();
                }
                Label.color = tintColor * LabelColorBlock.colorMultiplier * LabelColorMultiplier;
            }
            else if (tintTweener != null)
            {
                var tween = new ColorTween(Label.color, tintColor * LabelColorBlock.colorMultiplier * LabelColorMultiplier, ColorTweenMode.All, LabelColorBlock.fadeDuration, c => Label.color = c);
                tintTweener.Run(tween);
            }
        }