Exemplo n.º 1
0
 void DoTranslate()
 {
     if (Time.time >= _startTime)
     {
         Transform.localPosition = new Vector2(
             (float)EasingCurves.Evaluate(_xCurve, Time.time - _startTime, _startPosition.x, _translation.x, _duration),
             (float)EasingCurves.Evaluate(_yCurve, Time.time - _startTime, _startPosition.y, _translation.y, _duration));
     }
 }
Exemplo n.º 2
0
        public void Tick(float realDeltaTime)
        {
            float mod = (float)EasingCurves.SineEaseOut(Time.time, 0.5, 0.5, _duration);

            float r = _startColor.r + (_endColor.r - _startColor.r) * mod;
            float g = _startColor.g + (_endColor.g - _startColor.g) * mod;
            float b = _startColor.b + (_endColor.b - _startColor.b) * mod;
            float a = _startColor.a + (_endColor.a - _startColor.a) * mod;

            _text.color = new Color(r, g, b, a);
        }
        void DoRescale()
        {
            if (Time.time >= _startTime) {
                float duration = _inverseLoop ? _duration * 2 : _duration;
                Transform.localScale = new Vector3(
                            (float)EasingCurves.Evaluate(_xCurve, Time.time - _startTime, _baseScale.x, _modScale.x, duration),
                            (float)EasingCurves.Evaluate(_yCurve, Time.time - _startTime, _baseScale.y, _modScale.y, duration),
                            0);

            }
        }
Exemplo n.º 4
0
        void DoFlick()
        {
            if (Time.time >= _startTime)
            {
                float duration = _inverseLoop ? _duration * 2 : _duration;
                float mod      = (float)EasingCurves.Evaluate(_curve, Time.time - _startTime, _baseMod, _finalMod, duration);

                float r = _startColor.r + (_endColor.r - _startColor.r) * mod;
                float g = _startColor.g + (_endColor.g - _startColor.g) * mod;
                float b = _startColor.b + (_endColor.b - _startColor.b) * mod;
                float a = _startColor.a + (_endColor.a - _startColor.a) * mod;

                _image.color = new Color(r, g, b, a);
            }
        }