Example #1
0
	public static void animFloatCallbacks(DOGetter<float> getter, DOSetter<float> setter, float duration, float animTo, TweenCallback onUpd, TweenCallback onComp, Ease easeType = Ease.Linear) {
		DOTween.To(getter, setter, animTo, duration).SetEase(easeType).SetUpdate(false).OnUpdate(onUpd).OnComplete(onComp);
	}
Example #2
0
        public override float GetSpeedBasedDuration(VectorOptions options, float unitsXSecond, Vector2 changeValue) => default; // 0x004D3FC0-0x004D3FF0

        public override void EvaluateAndApply(VectorOptions options, Tween t, bool isRelative, DOGetter <Vector2> getter, DOSetter <Vector2> setter, float elapsed, Vector2 startValue, Vector2 changeValue, float duration, bool usingInversePosition, UpdateNotice updateNotice)
        {
        }                                                                                                                                                                                                                                                                                   // 0x004D3FF0-0x004D44C0
Example #3
0
        public override void EvaluateAndApply(NoOptions options, Tween t, bool isRelative, DOGetter <VertexGradient> getter, DOSetter <VertexGradient> setter, float elapsed,
                                              VertexGradient startValue, VertexGradient changeValue, float duration, bool usingInversePosition,
                                              UpdateNotice updateNotice)
        {
            var easeVal = EaseManager.Evaluate(t, elapsed, duration, t.easeOvershootOrAmplitude, t.easePeriod);

            setter(Add(startValue, Multiply(changeValue, easeVal)));
        }
Example #4
0
        public override float GetSpeedBasedDuration(ColorOptions options, float unitsXSecond, Color changeValue) => default; // 0x004CEDB0-0x004CEDC0

        public override void EvaluateAndApply(ColorOptions options, Tween t, bool isRelative, DOGetter <Color> getter, DOSetter <Color> setter, float elapsed, Color startValue, Color changeValue, float duration, bool usingInversePosition, UpdateNotice updateNotice)
        {
        }                                                                                                                                                                                                                                                                          // 0x004CEDC0-0x004CF000
Example #5
0
        public override void EvaluateAndApply(PathOptions options, Tween t, bool isRelative, DOGetter <Vector3> getter, DOSetter <Vector3> setter, float elapsed, Path startValue, Path changeValue, float duration, bool usingInversePosition, UpdateNotice updateNotice)
        {
            if (t.loopType == LoopType.Incremental && !options.isClosedPath)
            {
                int increment = (t.isComplete ? t.completedLoops - 1 : t.completedLoops);
                if (increment > 0)
                {
                    changeValue = changeValue.CloneIncremental(increment);
                }
            }

            float   pathPerc         = EaseManager.Evaluate(t.easeType, t.customEase, elapsed, duration, t.easeOvershootOrAmplitude, t.easePeriod);
            float   constantPathPerc = changeValue.ConvertToConstantPathPerc(pathPerc);
            Vector3 newPos           = changeValue.GetPoint(constantPathPerc);

            changeValue.targetPosition = newPos; // Used to draw editor gizmos
            setter(newPos);

            if (options.mode != PathMode.Ignore && options.orientType != OrientType.None)
            {
                SetOrientation(options, t, changeValue, constantPathPerc, newPos, updateNotice);
            }

            // Determine if current waypoint changed and eventually dispatch callback
            bool isForward = !usingInversePosition;

            if (t.isBackwards)
            {
                isForward = !isForward;
            }
            int newWaypointIndex = changeValue.GetWaypointIndexFromPerc(pathPerc, isForward);

            if (newWaypointIndex != t.miscInt)
            {
                int prevWPIndex = t.miscInt;
                t.miscInt = newWaypointIndex;
                if (t.onWaypointChange != null)
                {
                    // If more than one waypoint changed, dispatch multiple callbacks
                    bool isBackwards = newWaypointIndex < prevWPIndex;
                    if (isBackwards)
                    {
                        for (int i = prevWPIndex - 1; i > newWaypointIndex - 1; --i)
                        {
                            Tween.OnTweenCallback(t.onWaypointChange, i);
                        }
                    }
                    else
                    {
                        for (int i = prevWPIndex + 1; i < newWaypointIndex + 1; ++i)
                        {
                            Tween.OnTweenCallback(t.onWaypointChange, i);
                        }
                    }
                }
            }
        }
Example #6
0
 public static void animFloatCallbackU(DOGetter<float> getter, DOSetter<float> setter, float duration, float animTo, TweenCallback onUpd)
 {
     DOTween.To(getter, setter, animTo, duration).SetUpdate(false).OnUpdate(onUpd);
 }
Example #7
0
        public override void EvaluateAndApply(RectOptions options, Tween t, bool isRelative, DOGetter <Rect> getter, DOSetter <Rect> setter, float elapsed, Rect startValue, Rect changeValue, float duration, bool usingInversePosition, UpdateNotice updateNotice)
        {
            if (t.loopType == LoopType.Incremental)
            {
                int num = t.isComplete ? (t.completedLoops - 1) : t.completedLoops;
                startValue.x      += changeValue.x * (float)num;
                startValue.y      += changeValue.y * (float)num;
                startValue.width  += changeValue.width * (float)num;
                startValue.height += changeValue.height * (float)num;
            }
            if (t.isSequenced && t.sequenceParent.loopType == LoopType.Incremental)
            {
                int num2 = ((t.loopType == LoopType.Incremental) ? t.loops : 1) * (t.sequenceParent.isComplete ? (t.sequenceParent.completedLoops - 1) : t.sequenceParent.completedLoops);
                startValue.x      += changeValue.x * (float)num2;
                startValue.y      += changeValue.y * (float)num2;
                startValue.width  += changeValue.width * (float)num2;
                startValue.height += changeValue.height * (float)num2;
            }
            float num3 = EaseManager.Evaluate(t.easeType, t.customEase, elapsed, duration, t.easeOvershootOrAmplitude, t.easePeriod);

            startValue.x      += changeValue.x * num3;
            startValue.y      += changeValue.y * num3;
            startValue.width  += changeValue.width * num3;
            startValue.height += changeValue.height * num3;
            if (options.snapping)
            {
                startValue.x      = (float)Math.Round((double)startValue.x);
                startValue.y      = (float)Math.Round((double)startValue.y);
                startValue.width  = (float)Math.Round((double)startValue.width);
                startValue.height = (float)Math.Round((double)startValue.height);
            }
            setter(startValue);
        }
Example #8
0
 public override void EvaluateAndApply(NoOptions options, Tween t, bool isRelative, DOGetter <ulong> getter, DOSetter <ulong> setter, float elapsed, ulong startValue, ulong changeValue, float duration, bool usingInversePosition, UpdateNotice updateNotice)
 {
     if (t.loopType == LoopType.Incremental)
     {
         startValue += changeValue * (uint)(t.isComplete ? (t.completedLoops - 1) : t.completedLoops);
     }
     if (t.isSequenced && t.sequenceParent.loopType == LoopType.Incremental)
     {
         startValue += changeValue * (uint)((t.loopType != LoopType.Incremental) ? 1 : t.loops) * (uint)(t.sequenceParent.isComplete ? (t.sequenceParent.completedLoops - 1) : t.sequenceParent.completedLoops);
     }
     setter((ulong)((decimal)startValue + (decimal)changeValue * (decimal)EaseManager.Evaluate(t.easeType, t.customEase, elapsed, duration, t.easeOvershootOrAmplitude, t.easePeriod)));
 }
Example #9
0
 public abstract void EvaluateAndApply(TPlugOptions options, Tween t, bool isRelative, DOGetter <T1> getter, DOSetter <T1> setter, float elapsed, T2 startValue, T2 changeValue, float duration, bool usingInversePosition, UpdateNotice updateNotice);
Example #10
0
        public override void EvaluateAndApply(ColorOptions options, Tween t, bool isRelative, DOGetter <Color> getter, DOSetter <Color> setter, float elapsed, Color startValue, Color changeValue, float duration, bool usingInversePosition, UpdateNotice updateNotice)
        {
            if (t.loopType == LoopType.Incremental)
            {
                startValue += changeValue * (float)(t.isComplete ? (t.completedLoops - 1) : t.completedLoops);
            }
            if (t.isSequenced && t.sequenceParent.loopType == LoopType.Incremental)
            {
                startValue += changeValue * (float)((t.loopType == LoopType.Incremental) ? t.loops : 1) * (float)(t.sequenceParent.isComplete ? (t.sequenceParent.completedLoops - 1) : t.sequenceParent.completedLoops);
            }
            float num = EaseManager.Evaluate(t.easeType, t.customEase, elapsed, duration, t.easeOvershootOrAmplitude, t.easePeriod);

            if (!options.alphaOnly)
            {
                startValue.r += changeValue.r * num;
                startValue.g += changeValue.g * num;
                startValue.b += changeValue.b * num;
                startValue.a += changeValue.a * num;
                setter(startValue);
                return;
            }
            Color pNewValue = getter();

            pNewValue.a = startValue.a + changeValue.a * num;
            setter(pNewValue);
        }
Example #11
0
        public override void EvaluateAndApply(NoOptions options, Tween t, bool isRelative, DOGetter <RectOffset> getter, DOSetter <RectOffset> setter, float elapsed, RectOffset startValue, RectOffset changeValue, float duration, bool usingInversePosition)
        {
            _r.left   = startValue.left;
            _r.right  = startValue.right;
            _r.top    = startValue.top;
            _r.bottom = startValue.bottom;

            if (t.loopType == LoopType.Incremental)
            {
                int iterations = t.isComplete ? t.completedLoops - 1 : t.completedLoops;
                _r.left   += changeValue.left * iterations;
                _r.right  += changeValue.right * iterations;
                _r.top    += changeValue.top * iterations;
                _r.bottom += changeValue.bottom * iterations;
            }
            if (t.isSequenced && t.sequenceParent.loopType == LoopType.Incremental)
            {
                int iterations = (t.loopType == LoopType.Incremental ? t.loops : 1)
                                 * (t.sequenceParent.isComplete ? t.sequenceParent.completedLoops - 1 : t.sequenceParent.completedLoops);
                _r.left   += changeValue.left * iterations;
                _r.right  += changeValue.right * iterations;
                _r.top    += changeValue.top * iterations;
                _r.bottom += changeValue.bottom * iterations;
            }

            float easeVal = EaseManager.Evaluate(t, elapsed, duration, t.easeOvershootOrAmplitude, t.easePeriod);

            setter(
                new RectOffset(
                    (int)Math.Round(_r.left + changeValue.left * easeVal),
                    (int)Math.Round(_r.right + changeValue.right * easeVal),
                    (int)Math.Round(_r.top + changeValue.top * easeVal),
                    (int)Math.Round(_r.bottom + changeValue.bottom * easeVal)
                    )
                );
        }
        public override void EvaluateAndApply(SpiralOptions options, Tween t, bool isRelative, DOGetter <Vector3> getter, DOSetter <Vector3> setter, float elapsed, Vector3 startValue, Vector3 changeValue, float duration, bool usingInversePosition, UpdateNotice updateNotice)
        {
            float num  = EaseManager.Evaluate(t, elapsed, duration, t.easeOvershootOrAmplitude, t.easePeriod);
            float num2 = (options.mode == SpiralMode.ExpandThenContract && num > 0.5f) ? (0.5f - (num - 0.5f)) : num;

            if (t.loopType == LoopType.Incremental)
            {
                num += (float)(t.isComplete ? (t.completedLoops - 1) : t.completedLoops);
            }
            float num3 = duration * options.speed * num;

            options.unit = duration * options.speed * num2;
            Vector3 vector = new Vector3(options.unit * Mathf.Cos(num3 * options.frequency), options.unit * Mathf.Sin(num3 * options.frequency), options.depth * num);

            vector = options.axisQ * vector + startValue;
            if (options.snapping)
            {
                vector.x = (float)Math.Round((double)vector.x);
                vector.y = (float)Math.Round((double)vector.y);
                vector.z = (float)Math.Round((double)vector.z);
            }
            setter(vector);
        }
Example #13
0
        public override void EvaluateAndApply(UintOptions options, Tween t, bool isRelative, DOGetter <uint> getter, DOSetter <uint> setter, float elapsed, uint startValue, uint changeValue, float duration, bool usingInversePosition, UpdateNotice updateNotice)
        {
            uint v;

            if (t.loopType == LoopType.Incremental)
            {
                v = (uint)(changeValue * (t.isComplete ? t.completedLoops - 1 : t.completedLoops));
                if (options.isNegativeChangeValue)
                {
                    startValue -= v;
                }
                else
                {
                    startValue += v;
                }
            }
            if (t.isSequenced && t.sequenceParent.loopType == LoopType.Incremental)
            {
                v = (uint)(changeValue * (t.loopType == LoopType.Incremental ? t.loops : 1)
                           * (t.sequenceParent.isComplete ? t.sequenceParent.completedLoops - 1 : t.sequenceParent.completedLoops));
                if (options.isNegativeChangeValue)
                {
                    startValue -= v;
                }
                else
                {
                    startValue += v;
                }
            }

            v = (uint)Math.Round(changeValue * EaseManager.Evaluate(t.easeType, t.customEase, elapsed, duration, t.easeOvershootOrAmplitude, t.easePeriod));
            if (options.isNegativeChangeValue)
            {
                setter(startValue - v);
            }
            else
            {
                setter(startValue + v);
            }
        }
Example #14
0
        public override void EvaluateAndApply(StringOptions options, Tween t, bool isRelative, DOGetter <string> getter, DOSetter <string> setter, float elapsed, string startValue, string changeValue, float duration, bool usingInversePosition, UpdateNotice updateNotice)
        {
            StringPlugin._Buffer.Remove(0, StringPlugin._Buffer.Length);
            if (isRelative && t.loopType == LoopType.Incremental)
            {
                int num = t.isComplete ? (t.completedLoops - 1) : t.completedLoops;
                if (num > 0)
                {
                    StringPlugin._Buffer.Append(startValue);
                    for (int i = 0; i < num; i++)
                    {
                        StringPlugin._Buffer.Append(changeValue);
                    }
                    startValue = StringPlugin._Buffer.ToString();
                    StringPlugin._Buffer.Remove(0, StringPlugin._Buffer.Length);
                }
            }
            int num2 = options.richTextEnabled ? options.startValueStrippedLength : startValue.Length;
            int num3 = options.richTextEnabled ? options.changeValueStrippedLength : changeValue.Length;
            int num4 = (int)Math.Round((double)((float)num3 * EaseManager.Evaluate(t.easeType, t.customEase, elapsed, duration, t.easeOvershootOrAmplitude, t.easePeriod)));

            if (num4 > num3)
            {
                num4 = num3;
            }
            else if (num4 < 0)
            {
                num4 = 0;
            }
            if (isRelative)
            {
                StringPlugin._Buffer.Append(startValue);
                if (options.scrambleMode != ScrambleMode.None)
                {
                    setter(this.Append(changeValue, 0, num4, options.richTextEnabled).AppendScrambledChars(num3 - num4, this.ScrambledCharsToUse(options)).ToString());
                    return;
                }
                setter(this.Append(changeValue, 0, num4, options.richTextEnabled).ToString());
                return;
            }
            else
            {
                if (options.scrambleMode != ScrambleMode.None)
                {
                    setter(this.Append(changeValue, 0, num4, options.richTextEnabled).AppendScrambledChars(num3 - num4, this.ScrambledCharsToUse(options)).ToString());
                    return;
                }
                int num5 = num2 - num3;
                int num6 = num2;
                if (num5 > 0)
                {
                    float num7 = (float)num4 / (float)num3;
                    num6 -= (int)((float)num6 * num7);
                }
                else
                {
                    num6 -= num4;
                }
                this.Append(changeValue, 0, num4, options.richTextEnabled);
                if (num4 < num3 && num4 < num2)
                {
                    this.Append(startValue, num4, options.richTextEnabled ? (num4 + num6) : num6, options.richTextEnabled);
                }
                setter(StringPlugin._Buffer.ToString());
                return;
            }
        }
Example #15
0
 public static TweenerCore<Color, Color, ColorOptions> To( DOGetter<Color> getter, DOSetter<Color> setter, Color endValue, DOTData data )
 {
     return DOTween.To( getter, setter, endValue, data.duration ).SetEase( data.ease );
 }
Example #16
0
        public override void EvaluateAndApply(VectorOptions options, Tween t, bool isRelative, DOGetter <Vector4> getter, DOSetter <Vector4> setter, float elapsed, Vector4 startValue, Vector4 changeValue, float duration)
        {
            if (t.loopType == LoopType.Incremental)
            {
                startValue += changeValue * (t.isComplete ? t.completedLoops - 1 : t.completedLoops);
            }
            if (t.isSequenced && t.sequenceParent.loopType == LoopType.Incremental)
            {
                startValue += changeValue * (t.loopType == LoopType.Incremental ? t.loops : 1)
                              * (t.sequenceParent.isComplete ? t.sequenceParent.completedLoops - 1 : t.sequenceParent.completedLoops);
            }

            switch (options.axisConstraint)
            {
            case AxisConstraint.X:
                Vector4 resX = getter();
                resX.x = EaseManager.Evaluate(t, elapsed, startValue.x, changeValue.x, duration, t.easeOvershootOrAmplitude, t.easePeriod);
                if (options.snapping)
                {
                    resX.x = (float)Math.Round(resX.x);
                }
                setter(resX);
                break;

            case AxisConstraint.Y:
                Vector4 resY = getter();
                resY.y = EaseManager.Evaluate(t, elapsed, startValue.y, changeValue.y, duration, t.easeOvershootOrAmplitude, t.easePeriod);
                if (options.snapping)
                {
                    resY.y = (float)Math.Round(resY.y);
                }
                setter(resY);
                break;

            case AxisConstraint.Z:
                Vector4 resZ = getter();
                resZ.z = EaseManager.Evaluate(t, elapsed, startValue.z, changeValue.z, duration, t.easeOvershootOrAmplitude, t.easePeriod);
                if (options.snapping)
                {
                    resZ.z = (float)Math.Round(resZ.z);
                }
                setter(resZ);
                break;

            case AxisConstraint.W:
                Vector4 resW = getter();
                resW.w = EaseManager.Evaluate(t, elapsed, startValue.w, changeValue.w, duration, t.easeOvershootOrAmplitude, t.easePeriod);
                if (options.snapping)
                {
                    resW.w = (float)Math.Round(resW.w);
                }
                setter(resW);
                break;

            default:
                startValue.x = EaseManager.Evaluate(t, elapsed, startValue.x, changeValue.x, duration, t.easeOvershootOrAmplitude, t.easePeriod);
                startValue.y = EaseManager.Evaluate(t, elapsed, startValue.y, changeValue.y, duration, t.easeOvershootOrAmplitude, t.easePeriod);
                startValue.z = EaseManager.Evaluate(t, elapsed, startValue.z, changeValue.z, duration, t.easeOvershootOrAmplitude, t.easePeriod);
                startValue.w = EaseManager.Evaluate(t, elapsed, startValue.w, changeValue.w, duration, t.easeOvershootOrAmplitude, t.easePeriod);
                if (options.snapping)
                {
                    startValue.x = (float)Math.Round(startValue.x);
                    startValue.y = (float)Math.Round(startValue.y);
                    startValue.z = (float)Math.Round(startValue.z);
                    startValue.w = (float)Math.Round(startValue.w);
                }
                setter(startValue);
                break;
            }
        }
Example #17
0
 public static TweenerCore<Vector3, Vector3, VectorOptions> To( DOGetter<Vector3> getter, DOSetter<Vector3> setter, Vector3 endValue, DOTData data )
 {
     return DOTween.To( getter, setter, endValue, data.duration ).SetEase( data.ease );
 }
Example #18
0
 TweenerCore <float, float, FloatOptions> Fade(DOGetter <float> getter, DOSetter <float> setter,
                                               float duration, float to)
 {
     return(DOTween.To(getter, setter, to, duration));
 }
Example #19
0
        public override float GetSpeedBasedDuration(NoOptions options, float unitsXSecond, double changeValue) => default; // 0x004CF730-0x004CF750

        public override void EvaluateAndApply(NoOptions options, Tween t, bool isRelative, DOGetter <double> getter, DOSetter <double> setter, float elapsed, double startValue, double changeValue, float duration, bool usingInversePosition, UpdateNotice updateNotice)
        {
        }                                                                                                                                                                                                                                                                           // 0x004CF750-0x004CF890
Example #20
0
 TweenerCore <float, float, FloatOptions> FadeOut(DOGetter <float> getter, DOSetter <float> setter,
                                                  float duration)
 {
     return(Fade(getter, setter, duration, 0f).SetEase(fadeOutEase));
 }
Example #21
0
        public override void EvaluateAndApply(Vector3ArrayOptions options, Tween t, bool isRelative, DOGetter <Vector3> getter, DOSetter <Vector3> setter, float elapsed, Vector3[] startValue, Vector3[] changeValue, float duration, bool usingInversePosition, UpdateNotice updateNotice)
        {
            Vector3 a = Vector3.zero;

            if (t.loopType == LoopType.Incremental)
            {
                int num = t.isComplete ? (t.completedLoops - 1) : t.completedLoops;
                if (num > 0)
                {
                    int num2 = startValue.Length - 1;
                    a = (startValue[num2] + changeValue[num2] - startValue[0]) * (float)num;
                }
            }
            if (t.isSequenced && t.sequenceParent.loopType == LoopType.Incremental)
            {
                int num3 = ((t.loopType == LoopType.Incremental) ? t.loops : 1) * (t.sequenceParent.isComplete ? (t.sequenceParent.completedLoops - 1) : t.sequenceParent.completedLoops);
                if (num3 > 0)
                {
                    int num4 = startValue.Length - 1;
                    a += (startValue[num4] + changeValue[num4] - startValue[0]) * (float)num3;
                }
            }
            int   num5 = 0;
            float num6 = 0f;
            float num7 = 0f;
            int   num8 = options.durations.Length;
            float num9 = 0f;

            for (int i = 0; i < num8; i++)
            {
                num7  = options.durations[i];
                num9 += num7;
                if (elapsed <= num9)
                {
                    num5 = i;
                    num6 = elapsed - num6;
                    break;
                }
                num6 += num7;
            }
            float          num10          = EaseManager.Evaluate(t.easeType, t.customEase, num6, num7, t.easeOvershootOrAmplitude, t.easePeriod);
            AxisConstraint axisConstraint = options.axisConstraint;
            Vector3        pNewValue;

            switch (axisConstraint)
            {
            case AxisConstraint.X:
                pNewValue   = getter();
                pNewValue.x = startValue[num5].x + a.x + changeValue[num5].x * num10;
                if (options.snapping)
                {
                    pNewValue.x = (float)Math.Round((double)pNewValue.x);
                }
                setter(pNewValue);
                return;

            case (AxisConstraint)3:
                break;

            case AxisConstraint.Y:
                pNewValue   = getter();
                pNewValue.y = startValue[num5].y + a.y + changeValue[num5].y * num10;
                if (options.snapping)
                {
                    pNewValue.y = (float)Math.Round((double)pNewValue.y);
                }
                setter(pNewValue);
                return;

            default:
                if (axisConstraint == AxisConstraint.Z)
                {
                    pNewValue   = getter();
                    pNewValue.z = startValue[num5].z + a.z + changeValue[num5].z * num10;
                    if (options.snapping)
                    {
                        pNewValue.z = (float)Math.Round((double)pNewValue.z);
                    }
                    setter(pNewValue);
                    return;
                }
                break;
            }
            pNewValue.x = startValue[num5].x + a.x + changeValue[num5].x * num10;
            pNewValue.y = startValue[num5].y + a.y + changeValue[num5].y * num10;
            pNewValue.z = startValue[num5].z + a.z + changeValue[num5].z * num10;
            if (options.snapping)
            {
                pNewValue.x = (float)Math.Round((double)pNewValue.x);
                pNewValue.y = (float)Math.Round((double)pNewValue.y);
                pNewValue.z = (float)Math.Round((double)pNewValue.z);
            }
            setter(pNewValue);
        }
        public override void EvaluateAndApply(RectOptions options, Tween t, bool isRelative, DOGetter <Rect> getter, DOSetter <Rect> setter, float elapsed, Rect startValue, Rect changeValue, float duration, bool usingInversePosition)
        {
            if (t.loopType == LoopType.Incremental)
            {
                int iterations = t.isComplete ? t.completedLoops - 1 : t.completedLoops;
                startValue.x      += changeValue.x * iterations;
                startValue.y      += changeValue.y * iterations;
                startValue.width  += changeValue.width * iterations;
                startValue.height += changeValue.height * iterations;
            }
            if (t.isSequenced && t.sequenceParent.loopType == LoopType.Incremental)
            {
                int iterations = (t.loopType == LoopType.Incremental ? t.loops : 1)
                                 * (t.sequenceParent.isComplete ? t.sequenceParent.completedLoops - 1 : t.sequenceParent.completedLoops);
                startValue.x      += changeValue.x * iterations;
                startValue.y      += changeValue.y * iterations;
                startValue.width  += changeValue.width * iterations;
                startValue.height += changeValue.height * iterations;
            }

            float easeVal = EaseManager.Evaluate(t.easeType, t.customEase, elapsed, duration, t.easeOvershootOrAmplitude, t.easePeriod);

            startValue.x      += changeValue.x * easeVal;
            startValue.y      += changeValue.y * easeVal;
            startValue.width  += changeValue.width * easeVal;
            startValue.height += changeValue.height * easeVal;
            if (options.snapping)
            {
                startValue.x      = (float)Math.Round(startValue.x);
                startValue.y      = (float)Math.Round(startValue.y);
                startValue.width  = (float)Math.Round(startValue.width);
                startValue.height = (float)Math.Round(startValue.height);
            }
            setter(startValue);
        }
Example #23
0
 public static Tweener DoTweenTo(DOGetter <float> getter, DOSetter <float> setter, float endValue, float duration)
 {
     return(DOTween.To(getter, setter, endValue, duration));
 }
Example #24
0
        public override void EvaluateAndApply(ColorOptions options, Tween t, bool isRelative, DOGetter <Color> getter, DOSetter <Color> setter, float elapsed, Color startValue, Color changeValue, float duration, bool usingInversePosition)
        {
            if (t.loopType == LoopType.Incremental)
            {
                startValue += changeValue * (t.isComplete ? t.completedLoops - 1 : t.completedLoops);
            }
            if (t.isSequenced && t.sequenceParent.loopType == LoopType.Incremental)
            {
                startValue += changeValue * (t.loopType == LoopType.Incremental ? t.loops : 1)
                              * (t.sequenceParent.isComplete ? t.sequenceParent.completedLoops - 1 : t.sequenceParent.completedLoops);
            }

            float easeVal = EaseManager.Evaluate(t, elapsed, duration, t.easeOvershootOrAmplitude, t.easePeriod);

            if (!options.alphaOnly)
            {
                startValue.r += changeValue.r * easeVal;
                startValue.g += changeValue.g * easeVal;
                startValue.b += changeValue.b * easeVal;
                startValue.a += changeValue.a * easeVal;
                setter(startValue);
                return;
            }

            // Alpha only
            Color res = getter();

            res.a = startValue.a + changeValue.a * easeVal;
            setter(res);
        }
Example #25
0
        public override void EvaluateAndApply(VectorOptions options, Tween t, bool isRelative, DOGetter <Vector2> getter, DOSetter <Vector2> setter, float elapsed, Vector2 startValue, Vector2 changeValue, float duration, bool usingInversePosition, UpdateNotice updateNotice)
        {
            if (t.loopType == LoopType.Incremental)
            {
                startValue += changeValue * (t.isComplete ? t.completedLoops - 1 : t.completedLoops);
            }
            if (t.isSequenced && t.sequenceParent.loopType == LoopType.Incremental)
            {
                startValue += changeValue * (t.loopType == LoopType.Incremental ? t.loops : 1)
                              * (t.sequenceParent.isComplete ? t.sequenceParent.completedLoops - 1 : t.sequenceParent.completedLoops);
            }

            float easeVal = EaseManager.Evaluate(t.easeType, t.customEase, elapsed, duration, t.easeOvershootOrAmplitude, t.easePeriod);

            switch (options.axisConstraint)
            {
            case AxisConstraint.X:
                Vector2 resX = getter();
                resX.x = startValue.x + changeValue.x * easeVal;
                if (options.snapping)
                {
                    resX.x = (float)Math.Round(resX.x);
                }
                setter(resX);
                break;

            case AxisConstraint.Y:
                Vector2 resY = getter();
                resY.y = startValue.y + changeValue.y * easeVal;
                if (options.snapping)
                {
                    resY.y = (float)Math.Round(resY.y);
                }
                setter(resY);
                break;

            default:
                startValue.x += changeValue.x * easeVal;
                startValue.y += changeValue.y * easeVal;
                if (options.snapping)
                {
                    startValue.x = (float)Math.Round(startValue.x);
                    startValue.y = (float)Math.Round(startValue.y);
                }
                setter(startValue);
                break;
            }
        }
Example #26
0
        public override float GetSpeedBasedDuration(RectOptions options, float unitsXSecond, Rect changeValue) => default; // 0x004D1E30-0x004D1F00

        public override void EvaluateAndApply(RectOptions options, Tween t, bool isRelative, DOGetter <Rect> getter, DOSetter <Rect> setter, float elapsed, Rect startValue, Rect changeValue, float duration, bool usingInversePosition, UpdateNotice updateNotice)
        {
        }                                                                                                                                                                                                                                                                     // 0x004D1F00-0x004D24F0
Example #27
0
        public override void EvaluateAndApply(NoOptions options, Tween t, bool isRelative, DOGetter <int> getter, DOSetter <int> setter, float elapsed, int startValue, int changeValue, float duration, bool usingInversePosition)
        {
            if (t.loopType == LoopType.Incremental)
            {
                startValue += changeValue * (t.isComplete ? t.completedLoops - 1 : t.completedLoops);
            }

            setter((int)Math.Round(startValue + changeValue * EaseManager.Evaluate(t.easeType, t.customEase, elapsed, duration, t.easeOvershootOrAmplitude, t.easePeriod)));
        }
Example #28
0
 public static void animFloatCallbackU(DOGetter <float> getter, DOSetter <float> setter, float duration, float animTo, TweenCallback onUpd)
 {
     DOTween.To(getter, setter, animTo, duration).SetUpdate(false).OnUpdate(onUpd);
 }
Example #29
0
 public override void EvaluateAndApply(TweenPlugValueSetOptions options, Tween t, bool isRelative, DOGetter <float> getter, DOSetter <float> setter, float elapsed, float startValue, float changeValue, float duration, bool usingInversePosition, UpdateNotice updateNotice)
 {
     if (updateNotice == UpdateNotice.RewindStep)
     {
         mCounter = -1;
     }
     else if (options.Refresh(ref mCounter))
     {
         setter(elapsed);
     }
 }
Example #30
0
 public static void animFloatCallbacks(DOGetter <float> getter, DOSetter <float> setter, float duration, float animTo, TweenCallback onUpd, TweenCallback onComp, Ease easeType = Ease.Linear)
 {
     DOTween.To(getter, setter, animTo, duration).SetEase(easeType).SetUpdate(false).OnUpdate(onUpd).OnComplete(onComp);
 }
Example #31
0
	public static void animVec2CallbackU(DOGetter<Vector2> getter, DOSetter<Vector2> setter, float duration, Vector2 animTo, TweenCallback onUpd, Ease easeType = Ease.Linear) {
		DOTween.To(getter, setter, animTo, duration).SetEase(easeType).SetUpdate(false).OnUpdate(onUpd);
	}
Example #32
0
 public static void animVec2CallbackU(DOGetter <Vector2> getter, DOSetter <Vector2> setter, float duration, Vector2 animTo, TweenCallback onUpd, Ease easeType = Ease.Linear)
 {
     DOTween.To(getter, setter, animTo, duration).SetEase(easeType).SetUpdate(false).OnUpdate(onUpd);
 }
Example #33
0
 public static TweenerCore<float, float, FloatOptions> To( DOGetter<float> getter, DOSetter<float> setter, float endValue, DOTData data )
 {
     return DOTween.To( getter, setter, endValue, data.duration ).SetEase( data.ease );
 }
Example #34
0
 public static void animInt(DOGetter <int> getter, DOSetter <int> setter, float duration, int animTo)
 {
     DOTween.To(getter, setter, animTo, duration).SetUpdate(false);
 }
Example #35
0
 public static void animVec2(DOGetter<Vector2> getter, DOSetter<Vector2> setter, float duration, Vector2 animTo)
 {
     DOTween.To(getter, setter, animTo, duration).SetUpdate(false);
 }
Example #36
0
 public CustomTargetTween <T> DOGetter(DOGetter <T> getter)
 {
     this.getter = getter;
     return(this);
 }
Example #37
0
 public static void animInt(DOGetter<int> getter, DOSetter<int> setter, float duration, int animTo)
 {
     DOTween.To(getter, setter, animTo, duration).SetUpdate(false);
 }
Example #38
0
        // Token: 0x060001BE RID: 446 RVA: 0x00009DA8 File Offset: 0x00007FA8
        public override void EvaluateAndApply(NoOptions options, Tween t, bool isRelative, DOGetter <RectOffset> getter, DOSetter <RectOffset> setter, float elapsed, RectOffset startValue, RectOffset changeValue, float duration, bool usingInversePosition, UpdateNotice updateNotice)
        {
            RectOffsetPlugin._r.left   = startValue.left;
            RectOffsetPlugin._r.right  = startValue.right;
            RectOffsetPlugin._r.top    = startValue.top;
            RectOffsetPlugin._r.bottom = startValue.bottom;
            if (t.loopType == LoopType.Incremental)
            {
                int num = t.isComplete ? (t.completedLoops - 1) : t.completedLoops;
                RectOffsetPlugin._r.left   += changeValue.left * num;
                RectOffsetPlugin._r.right  += changeValue.right * num;
                RectOffsetPlugin._r.top    += changeValue.top * num;
                RectOffsetPlugin._r.bottom += changeValue.bottom * num;
            }
            if (t.isSequenced && t.sequenceParent.loopType == LoopType.Incremental)
            {
                int num2 = ((t.loopType == LoopType.Incremental) ? t.loops : 1) * (t.sequenceParent.isComplete ? (t.sequenceParent.completedLoops - 1) : t.sequenceParent.completedLoops);
                RectOffsetPlugin._r.left   += changeValue.left * num2;
                RectOffsetPlugin._r.right  += changeValue.right * num2;
                RectOffsetPlugin._r.top    += changeValue.top * num2;
                RectOffsetPlugin._r.bottom += changeValue.bottom * num2;
            }
            float num3 = EaseManager.Evaluate(t.easeType, t.customEase, elapsed, duration, t.easeOvershootOrAmplitude, t.easePeriod);

            setter(new RectOffset((int)Math.Round((double)((float)RectOffsetPlugin._r.left + (float)changeValue.left * num3)), (int)Math.Round((double)((float)RectOffsetPlugin._r.right + (float)changeValue.right * num3)), (int)Math.Round((double)((float)RectOffsetPlugin._r.top + (float)changeValue.top * num3)), (int)Math.Round((double)((float)RectOffsetPlugin._r.bottom + (float)changeValue.bottom * num3))));
        }