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

            fadeTweener.Run(tween);
        }
Пример #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);
        }
Пример #3
0
        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);
        }
Пример #4
0
 private void CompleteAllRunners()
 {
     if (volumeTweener.IsRunning)
     {
         volumeTweener.CompleteInstantly();
     }
     if (stopTimer.IsRunning)
     {
         stopTimer.CompleteInstantly();
     }
 }
Пример #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);
            }
        }