Example #1
0
 public void AnimateIntensity(float extraIntensity, float time, Ease ease, LoopType loop, int loops, Action isDone)
 {
     if (isRunning && tween != null)
     {
         tween.Kill();
     }
     colorAnimType       = ColorAnimType.None;
     isRunning           = true;
     this.extraIntensity = extraIntensity;
     colorAnimIsTint     = false;
     currF = 0;
     tween = DOTween.To(ColorGetter, ColorSetter, 1, time).SetEase(ease)
             .SetLoops(loops, loop).OnComplete(() => {
         isRunning = false;
         isDone?.Invoke();
         if (updateStartingColorsOnEnd)
         {
             UpdateStartingColors();
         }
     });
 }
Example #2
0
        public void AnimateColorTo(Color col, float time, Ease ease, bool isTint, float extraIntensity, Action isDone)
        {
            if (isRunning && tween != null)
            {
                tween.Kill();
            }
            colorAnimType       = ColorAnimType.Direct;
            isRunning           = true;
            targetColor         = col;
            colorAnimIsTint     = isTint;
            this.extraIntensity = extraIntensity;
            currF = 0;

            tween = DOTween.To(ColorGetter, ColorSetter, 1, time).SetEase(ease).OnComplete(() => {
                isRunning = false;
                isDone?.Invoke();
                if (updateStartingColorsOnEnd)
                {
                    UpdateStartingColors();
                }
            });
        }