diff --git a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.XML b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.XML index 966f1e4..dfd017b 100644 --- a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.XML +++ b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.XML @@ -2187,5 +2187,21 @@ Public only so custom shortcuts can access some of these methods + + + Additional notices passed to plugins when updating. + Public so it can be used by custom plugins. Internally, only PathPlugin uses it + + + + + None + + + + + Lets the plugin know that we restarted or rewinded + + diff --git a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.dll b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.dll index 138b049..bdfe025 100644 Binary files a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.dll and b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.dll differ diff --git a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.dll.mdb b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.dll.mdb index d317e49..1872d90 100644 Binary files a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.dll.mdb and b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.dll.mdb differ diff --git a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween43.dll b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween43.dll index e0f10e5..ea46240 100644 Binary files a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween43.dll and b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween43.dll differ diff --git a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween43.dll.mdb b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween43.dll.mdb index 3566f4f..511036e 100644 Binary files a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween43.dll.mdb and b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween43.dll.mdb differ diff --git a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween46.dll b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween46.dll index 1c114c4..707b6ab 100644 Binary files a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween46.dll and b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween46.dll differ diff --git a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween46.dll.mdb b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween46.dll.mdb index d9fc32a..3e8cb06 100644 Binary files a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween46.dll.mdb and b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween46.dll.mdb differ diff --git a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween50.dll b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween50.dll index 7ceefb0..5af8dd1 100644 Binary files a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween50.dll and b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween50.dll differ diff --git a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween50.dll.mdb b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween50.dll.mdb index a6058f9..0b67c99 100644 Binary files a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween50.dll.mdb and b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween50.dll.mdb differ diff --git a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll index 1dd974d..4516ae5 100644 Binary files a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll and b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll differ diff --git a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb index 27af835..f2e13ac 100644 Binary files a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb and b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb differ diff --git a/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween.XML b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween.XML index 966f1e4..dfd017b 100644 --- a/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween.XML +++ b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween.XML @@ -2187,5 +2187,21 @@ Public only so custom shortcuts can access some of these methods + + + Additional notices passed to plugins when updating. + Public so it can be used by custom plugins. Internally, only PathPlugin uses it + + + + + None + + + + + Lets the plugin know that we restarted or rewinded + + diff --git a/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween.dll b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween.dll index 138b049..bdfe025 100644 Binary files a/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween.dll and b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween.dll differ diff --git a/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween.dll.mdb b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween.dll.mdb index d317e49..1872d90 100644 Binary files a/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween.dll.mdb and b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween.dll.mdb differ diff --git a/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween43.dll b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween43.dll index e0f10e5..ea46240 100644 Binary files a/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween43.dll and b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween43.dll differ diff --git a/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween43.dll.mdb b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween43.dll.mdb index 3566f4f..511036e 100644 Binary files a/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween43.dll.mdb and b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween43.dll.mdb differ diff --git a/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween46.dll b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween46.dll index 1c114c4..707b6ab 100644 Binary files a/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween46.dll and b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween46.dll differ diff --git a/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween46.dll.mdb b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween46.dll.mdb index d9fc32a..3e8cb06 100644 Binary files a/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween46.dll.mdb and b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween46.dll.mdb differ diff --git a/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween50.dll b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween50.dll index 7ceefb0..5af8dd1 100644 Binary files a/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween50.dll and b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween50.dll differ diff --git a/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween50.dll.mdb b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween50.dll.mdb index a6058f9..0b67c99 100644 Binary files a/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween50.dll.mdb and b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween50.dll.mdb differ diff --git a/UnityTests.Unity4/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll b/UnityTests.Unity4/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll index 1dd974d..4516ae5 100644 Binary files a/UnityTests.Unity4/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll and b/UnityTests.Unity4/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll differ diff --git a/UnityTests.Unity4/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb b/UnityTests.Unity4/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb index 27af835..f2e13ac 100644 Binary files a/UnityTests.Unity4/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb and b/UnityTests.Unity4/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb differ diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.XML b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.XML index 966f1e4..dfd017b 100644 --- a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.XML +++ b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.XML @@ -2187,5 +2187,21 @@ Public only so custom shortcuts can access some of these methods + + + Additional notices passed to plugins when updating. + Public so it can be used by custom plugins. Internally, only PathPlugin uses it + + + + + None + + + + + Lets the plugin know that we restarted or rewinded + + diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll index 138b049..bdfe025 100644 Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll and b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll differ diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll.mdb b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll.mdb index d317e49..1872d90 100644 Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll.mdb and b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll.mdb differ diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween43.dll b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween43.dll index e0f10e5..ea46240 100644 Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween43.dll and b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween43.dll differ diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween43.dll.mdb b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween43.dll.mdb index 3566f4f..511036e 100644 Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween43.dll.mdb and b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween43.dll.mdb differ diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween46.dll b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween46.dll index 1c114c4..707b6ab 100644 Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween46.dll and b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween46.dll differ diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween46.dll.mdb b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween46.dll.mdb index d9fc32a..3e8cb06 100644 Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween46.dll.mdb and b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween46.dll.mdb differ diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween50.dll b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween50.dll index 7ceefb0..5af8dd1 100644 Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween50.dll and b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween50.dll differ diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween50.dll.mdb b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween50.dll.mdb index a6058f9..0b67c99 100644 Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween50.dll.mdb and b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween50.dll.mdb differ diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll b/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll index 1dd974d..4516ae5 100644 Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll and b/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll differ diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb b/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb index 27af835..f2e13ac 100644 Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb and b/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb differ diff --git a/UnityTests.Unity5/Assets/_Tests/CustomPlugin Example/PlugCustomPlugin.cs b/UnityTests.Unity5/Assets/_Tests/CustomPlugin Example/PlugCustomPlugin.cs index 928b04b..6a736d2 100644 --- a/UnityTests.Unity5/Assets/_Tests/CustomPlugin Example/PlugCustomPlugin.cs +++ b/UnityTests.Unity5/Assets/_Tests/CustomPlugin Example/PlugCustomPlugin.cs @@ -1,6 +1,7 @@ using DG.Tweening; using DG.Tweening.Core; using DG.Tweening.Core.Easing; +using DG.Tweening.Core.Enums; using DG.Tweening.Plugins.Core; using DG.Tweening.Plugins.Options; using System; @@ -63,7 +64,7 @@ public class CustomPlugin : ABSTweenPlugin return res; } - public override void EvaluateAndApply(NoOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, Vector3 startValue, Vector3 changeValue, float duration, bool usingInversePosition) + public override void EvaluateAndApply(NoOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, Vector3 startValue, Vector3 changeValue, float duration, bool usingInversePosition, UpdateNotice updateNotice) { Vector3 res = getter(); float easeVal = EaseManager.Evaluate(t, elapsed, duration, t.easeOvershootOrAmplitude, t.easePeriod); diff --git a/UnityTests.Unity5/Assets/_Tests/Follow.cs b/UnityTests.Unity5/Assets/_Tests/Follow.cs index db1e559..bcce189 100644 --- a/UnityTests.Unity5/Assets/_Tests/Follow.cs +++ b/UnityTests.Unity5/Assets/_Tests/Follow.cs @@ -6,6 +6,7 @@ using System.Collections; public class Follow : BrainBase { public Transform target, follow; + public float someInt; void Start() { @@ -14,7 +15,15 @@ public class Follow : BrainBase tween.OnUpdate(() => { - tween.ChangeEndValue(follow.position, true); + // someInt = 0; + // someInt = follow.position.x + tween.ElapsedPercentage(); + // tween.ChangeEndValue(follow.position, true); + SomeFunction(follow.position); }); } + + void SomeFunction(T obj) + { + someInt = 1; + } } \ No newline at end of file diff --git a/_DOTween.Assembly/DOTween/Core/Enums/UpdateNotice.cs b/_DOTween.Assembly/DOTween/Core/Enums/UpdateNotice.cs new file mode 100644 index 0000000..b339c1e --- /dev/null +++ b/_DOTween.Assembly/DOTween/Core/Enums/UpdateNotice.cs @@ -0,0 +1,21 @@ +// Author: Daniele Giardini - http://www.demigiant.com +// Created: 2015/05/27 12:23 + +namespace DG.Tweening.Core.Enums +{ + /// + /// Additional notices passed to plugins when updating. + /// Public so it can be used by custom plugins. Internally, only PathPlugin uses it + /// + public enum UpdateNotice + { + /// + /// None + /// + None, + /// + /// Lets the plugin know that we restarted or rewinded + /// + RewindStep + } +} \ No newline at end of file diff --git a/_DOTween.Assembly/DOTween/Core/TweenerCore.cs b/_DOTween.Assembly/DOTween/Core/TweenerCore.cs index b2a3018..585cb0e 100644 --- a/_DOTween.Assembly/DOTween/Core/TweenerCore.cs +++ b/_DOTween.Assembly/DOTween/Core/TweenerCore.cs @@ -167,18 +167,18 @@ namespace DG.Tweening.Core // Applies the tween set by DoGoto. // Returns TRUE if the tween needs to be killed - internal override bool ApplyTween(float prevPosition, int prevCompletedLoops, int newCompletedSteps, bool useInversePosition, UpdateMode updateMode) + internal override bool ApplyTween(float prevPosition, int prevCompletedLoops, int newCompletedSteps, bool useInversePosition, UpdateMode updateMode, UpdateNotice updateNotice) { float updatePosition = useInversePosition ? duration - position : position; if (DOTween.useSafeMode) { try { - tweenPlugin.EvaluateAndApply(plugOptions, this, isRelative, getter, setter, updatePosition, startValue, changeValue, duration, useInversePosition); + tweenPlugin.EvaluateAndApply(plugOptions, this, isRelative, getter, setter, updatePosition, startValue, changeValue, duration, useInversePosition, updateNotice); } catch { // Target/field doesn't exist anymore: kill tween return true; } } else { - tweenPlugin.EvaluateAndApply(plugOptions, this, isRelative, getter, setter, updatePosition, startValue, changeValue, duration, useInversePosition); + tweenPlugin.EvaluateAndApply(plugOptions, this, isRelative, getter, setter, updatePosition, startValue, changeValue, duration, useInversePosition, updateNotice); } return false; } diff --git a/_DOTween.Assembly/DOTween/DOTween.cs b/_DOTween.Assembly/DOTween/DOTween.cs index 08b6035..e7833e2 100644 --- a/_DOTween.Assembly/DOTween/DOTween.cs +++ b/_DOTween.Assembly/DOTween/DOTween.cs @@ -32,7 +32,7 @@ namespace DG.Tweening public class DOTween { /// DOTween's version - public static readonly string Version = "1.0.745"; + public static readonly string Version = "1.0.750"; /////////////////////////////////////////////// // Options //////////////////////////////////// diff --git a/_DOTween.Assembly/DOTween/DOTween.csproj b/_DOTween.Assembly/DOTween/DOTween.csproj index 1f082af..8d4e52e 100644 --- a/_DOTween.Assembly/DOTween/DOTween.csproj +++ b/_DOTween.Assembly/DOTween/DOTween.csproj @@ -68,6 +68,7 @@ + diff --git a/_DOTween.Assembly/DOTween/Plugins/Color2Plugin.cs b/_DOTween.Assembly/DOTween/Plugins/Color2Plugin.cs index 1c97f2e..7920866 100644 --- a/_DOTween.Assembly/DOTween/Plugins/Color2Plugin.cs +++ b/_DOTween.Assembly/DOTween/Plugins/Color2Plugin.cs @@ -4,6 +4,7 @@ using System; using DG.Tweening.Core; using DG.Tweening.Core.Easing; +using DG.Tweening.Core.Enums; using DG.Tweening.Plugins.Core; using DG.Tweening.Plugins.Options; using UnityEngine; @@ -49,7 +50,7 @@ namespace DG.Tweening.Plugins return 1f / unitsXSecond; } - public override void EvaluateAndApply(ColorOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, Color2 startValue, Color2 changeValue, float duration, bool usingInversePosition) + public override void EvaluateAndApply(ColorOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, Color2 startValue, Color2 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) { diff --git a/_DOTween.Assembly/DOTween/Plugins/ColorPlugin.cs b/_DOTween.Assembly/DOTween/Plugins/ColorPlugin.cs index e66cec2..ef897ef 100644 --- a/_DOTween.Assembly/DOTween/Plugins/ColorPlugin.cs +++ b/_DOTween.Assembly/DOTween/Plugins/ColorPlugin.cs @@ -7,6 +7,7 @@ using DG.Tweening.Core; using DG.Tweening.Core.Easing; +using DG.Tweening.Core.Enums; using DG.Tweening.Plugins.Core; using DG.Tweening.Plugins.Options; using UnityEngine; @@ -49,7 +50,7 @@ namespace DG.Tweening.Plugins return 1f / unitsXSecond; } - public override void EvaluateAndApply(ColorOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, Color startValue, Color changeValue, float duration, bool usingInversePosition) + public override void EvaluateAndApply(ColorOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, Color startValue, Color 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) { diff --git a/_DOTween.Assembly/DOTween/Plugins/ColorWrapperPlugin.cs b/_DOTween.Assembly/DOTween/Plugins/ColorWrapperPlugin.cs index f733360..566039f 100644 --- a/_DOTween.Assembly/DOTween/Plugins/ColorWrapperPlugin.cs +++ b/_DOTween.Assembly/DOTween/Plugins/ColorWrapperPlugin.cs @@ -4,6 +4,7 @@ using DG.Tweening.Core; using DG.Tweening.Core.Easing; +using DG.Tweening.Core.Enums; using DG.Tweening.Core.Surrogates; using DG.Tweening.Plugins.Core; using DG.Tweening.Plugins.Options; @@ -47,7 +48,7 @@ namespace DG.Tweening.Plugins return 1f / unitsXSecond; } - public override void EvaluateAndApply(ColorOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, ColorWrapper startValue, ColorWrapper changeValue, float duration, bool usingInversePosition) + public override void EvaluateAndApply(ColorOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, ColorWrapper startValue, ColorWrapper changeValue, float duration, bool usingInversePosition, UpdateNotice updateNotice) { if (t.loopType == LoopType.Incremental) startValue.value += changeValue.value * (t.isComplete ? t.completedLoops - 1 : t.completedLoops); if (t.isSequenced && t.sequenceParent.loopType == LoopType.Incremental) { diff --git a/_DOTween.Assembly/DOTween/Plugins/Core/ABSTweenPlugin.cs b/_DOTween.Assembly/DOTween/Plugins/Core/ABSTweenPlugin.cs index a3a264f..de9306c 100644 --- a/_DOTween.Assembly/DOTween/Plugins/Core/ABSTweenPlugin.cs +++ b/_DOTween.Assembly/DOTween/Plugins/Core/ABSTweenPlugin.cs @@ -5,6 +5,7 @@ // This work is subject to the terms at http://dotween.demigiant.com/license.php using DG.Tweening.Core; +using DG.Tweening.Core.Enums; #pragma warning disable 1591 namespace DG.Tweening.Plugins.Core @@ -19,6 +20,6 @@ namespace DG.Tweening.Plugins.Core public abstract void SetChangeValue(TweenerCore t); public abstract float GetSpeedBasedDuration(TPlugOptions options, float unitsXSecond, T2 changeValue); // usingInversePosition is used by PathPlugin to calculate correctly the current waypoint reached - public abstract void EvaluateAndApply(TPlugOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, T2 startValue, T2 changeValue, float duration, bool usingInversePosition); + public abstract void EvaluateAndApply(TPlugOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, T2 startValue, T2 changeValue, float duration, bool usingInversePosition, UpdateNotice updateNotice); } } \ No newline at end of file diff --git a/_DOTween.Assembly/DOTween/Plugins/FloatPlugin.cs b/_DOTween.Assembly/DOTween/Plugins/FloatPlugin.cs index 1ea37a0..86c55e7 100644 --- a/_DOTween.Assembly/DOTween/Plugins/FloatPlugin.cs +++ b/_DOTween.Assembly/DOTween/Plugins/FloatPlugin.cs @@ -7,6 +7,7 @@ using System; using DG.Tweening.Core; using DG.Tweening.Core.Easing; +using DG.Tweening.Core.Enums; using DG.Tweening.Plugins.Core; using DG.Tweening.Plugins.Options; using UnityEngine; @@ -48,7 +49,7 @@ namespace DG.Tweening.Plugins return res; } - public override void EvaluateAndApply(FloatOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, float startValue, float changeValue, float duration, bool usingInversePosition) + public override void EvaluateAndApply(FloatOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, float startValue, float 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) { diff --git a/_DOTween.Assembly/DOTween/Plugins/IntPlugin.cs b/_DOTween.Assembly/DOTween/Plugins/IntPlugin.cs index df1167e..644ad21 100644 --- a/_DOTween.Assembly/DOTween/Plugins/IntPlugin.cs +++ b/_DOTween.Assembly/DOTween/Plugins/IntPlugin.cs @@ -7,6 +7,7 @@ using System; using DG.Tweening.Core; using DG.Tweening.Core.Easing; +using DG.Tweening.Core.Enums; using DG.Tweening.Plugins.Core; using DG.Tweening.Plugins.Options; @@ -47,7 +48,7 @@ namespace DG.Tweening.Plugins return res; } - public override void EvaluateAndApply(NoOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, int startValue, int changeValue, float duration, bool usingInversePosition) + public override void EvaluateAndApply(NoOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, int startValue, int 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) { diff --git a/_DOTween.Assembly/DOTween/Plugins/LongPlugin.cs b/_DOTween.Assembly/DOTween/Plugins/LongPlugin.cs index c355f63..49f1f5e 100644 --- a/_DOTween.Assembly/DOTween/Plugins/LongPlugin.cs +++ b/_DOTween.Assembly/DOTween/Plugins/LongPlugin.cs @@ -4,6 +4,7 @@ using System; using DG.Tweening.Core; using DG.Tweening.Core.Easing; +using DG.Tweening.Core.Enums; using DG.Tweening.Plugins.Core; using DG.Tweening.Plugins.Options; @@ -44,7 +45,7 @@ namespace DG.Tweening.Plugins return res; } - public override void EvaluateAndApply(NoOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, long startValue, long changeValue, float duration, bool usingInversePosition) + public override void EvaluateAndApply(NoOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, long startValue, long 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) { diff --git a/_DOTween.Assembly/DOTween/Plugins/Options/PathOptions.cs b/_DOTween.Assembly/DOTween/Plugins/Options/PathOptions.cs index ce0a8cb..2efd72f 100644 --- a/_DOTween.Assembly/DOTween/Plugins/Options/PathOptions.cs +++ b/_DOTween.Assembly/DOTween/Plugins/Options/PathOptions.cs @@ -31,6 +31,7 @@ namespace DG.Tweening.Plugins.Options public bool useLocalPosition; public Transform parent; // Only used with OrientType.ToPath and useLocalPosition set as TRUE + internal Quaternion startupRot; // Used to reset orientation when rewinding internal float startupZRot; // Used to store Z value in case of lock Z, in order to rotate things differently } } \ No newline at end of file diff --git a/_DOTween.Assembly/DOTween/Plugins/PathPlugin.cs b/_DOTween.Assembly/DOTween/Plugins/PathPlugin.cs index f04a077..ab95b6f 100644 --- a/_DOTween.Assembly/DOTween/Plugins/PathPlugin.cs +++ b/_DOTween.Assembly/DOTween/Plugins/PathPlugin.cs @@ -6,6 +6,7 @@ using DG.Tweening.Core; using DG.Tweening.Core.Easing; +using DG.Tweening.Core.Enums; using DG.Tweening.Plugins.Core; using DG.Tweening.Plugins.Core.PathCore; using DG.Tweening.Plugins.Options; @@ -87,6 +88,7 @@ namespace DG.Tweening.Plugins // Finalize path path.FinalizePath(t.plugOptions.isClosedPath, t.plugOptions.lockPositionAxis, currVal); + t.plugOptions.startupRot = trans.rotation; t.plugOptions.startupZRot = trans.eulerAngles.z; // Set changeValue as a reference to endValue @@ -98,7 +100,7 @@ namespace DG.Tweening.Plugins return changeValue.length / unitsXSecond; } - public override void EvaluateAndApply(PathOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, Path startValue, Path changeValue, float duration, bool usingInversePosition) + public override void EvaluateAndApply(PathOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, Path startValue, Path changeValue, float duration, bool usingInversePosition, UpdateNotice updateNotice) { float pathPerc = EaseManager.Evaluate(t.easeType, t.customEase, elapsed, duration, t.easeOvershootOrAmplitude, t.easePeriod); float constantPathPerc = changeValue.ConvertToConstantPathPerc(pathPerc); @@ -106,7 +108,7 @@ namespace DG.Tweening.Plugins 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); + 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; @@ -119,11 +121,16 @@ namespace DG.Tweening.Plugins } // Public so it can be called by GotoWaypoint - public void SetOrientation(PathOptions options, Tween t, Path path, float pathPerc, Vector3 tPos) + public void SetOrientation(PathOptions options, Tween t, Path path, float pathPerc, Vector3 tPos, UpdateNotice updateNotice) { Transform trans = (Transform)t.target; Quaternion newRot = Quaternion.identity; + if (updateNotice == UpdateNotice.RewindStep) { + // Reset orientation before continuing + trans.rotation = options.startupRot; + } + switch (options.orientType) { case OrientType.LookAtPosition: path.lookAtPosition = options.lookAtPosition; // Used to draw editor gizmos diff --git a/_DOTween.Assembly/DOTween/Plugins/QuaternionPlugin.cs b/_DOTween.Assembly/DOTween/Plugins/QuaternionPlugin.cs index e4d3dc6..0837b22 100644 --- a/_DOTween.Assembly/DOTween/Plugins/QuaternionPlugin.cs +++ b/_DOTween.Assembly/DOTween/Plugins/QuaternionPlugin.cs @@ -7,6 +7,7 @@ using DG.Tweening.Core; using DG.Tweening.Core.Easing; +using DG.Tweening.Core.Enums; using DG.Tweening.Plugins.Core; using DG.Tweening.Plugins.Options; using UnityEngine; @@ -79,7 +80,7 @@ namespace DG.Tweening.Plugins return changeValue.magnitude / unitsXSecond; } - public override void EvaluateAndApply(QuaternionOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, Vector3 startValue, Vector3 changeValue, float duration, bool usingInversePosition) + public override void EvaluateAndApply(QuaternionOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, Vector3 startValue, Vector3 changeValue, float duration, bool usingInversePosition, UpdateNotice updateNotice) { Vector3 endValue = startValue; diff --git a/_DOTween.Assembly/DOTween/Plugins/QuaternionWrapperPlugin.cs b/_DOTween.Assembly/DOTween/Plugins/QuaternionWrapperPlugin.cs index 4999d26..9cd9d94 100644 --- a/_DOTween.Assembly/DOTween/Plugins/QuaternionWrapperPlugin.cs +++ b/_DOTween.Assembly/DOTween/Plugins/QuaternionWrapperPlugin.cs @@ -4,6 +4,7 @@ using DG.Tweening.Core; using DG.Tweening.Core.Easing; +using DG.Tweening.Core.Enums; using DG.Tweening.Core.Surrogates; using DG.Tweening.Plugins.Core; using DG.Tweening.Plugins.Options; @@ -77,7 +78,7 @@ namespace DG.Tweening.Plugins return changeValue.value.magnitude / unitsXSecond; } - public override void EvaluateAndApply(QuaternionOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, Vector3Wrapper startValue, Vector3Wrapper changeValue, float duration, bool usingInversePosition) + public override void EvaluateAndApply(QuaternionOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, Vector3Wrapper startValue, Vector3Wrapper changeValue, float duration, bool usingInversePosition, UpdateNotice updateNotice) { Vector3 endValue = startValue.value; diff --git a/_DOTween.Assembly/DOTween/Plugins/RectOffsetPlugin.cs b/_DOTween.Assembly/DOTween/Plugins/RectOffsetPlugin.cs index f8fe406..8587dd4 100644 --- a/_DOTween.Assembly/DOTween/Plugins/RectOffsetPlugin.cs +++ b/_DOTween.Assembly/DOTween/Plugins/RectOffsetPlugin.cs @@ -7,6 +7,7 @@ using System; using DG.Tweening.Core; using DG.Tweening.Core.Easing; +using DG.Tweening.Core.Enums; using DG.Tweening.Plugins.Core; using DG.Tweening.Plugins.Options; using UnityEngine; @@ -73,7 +74,7 @@ namespace DG.Tweening.Plugins return diag / unitsXSecond; } - public override void EvaluateAndApply(NoOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, RectOffset startValue, RectOffset changeValue, float duration, bool usingInversePosition) + public override void EvaluateAndApply(NoOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, RectOffset startValue, RectOffset changeValue, float duration, bool usingInversePosition, UpdateNotice updateNotice) { _r.left = startValue.left; _r.right = startValue.right; diff --git a/_DOTween.Assembly/DOTween/Plugins/RectPlugin.cs b/_DOTween.Assembly/DOTween/Plugins/RectPlugin.cs index e4df111..6998db1 100644 --- a/_DOTween.Assembly/DOTween/Plugins/RectPlugin.cs +++ b/_DOTween.Assembly/DOTween/Plugins/RectPlugin.cs @@ -7,6 +7,7 @@ using System; using DG.Tweening.Core; using DG.Tweening.Core.Easing; +using DG.Tweening.Core.Enums; using DG.Tweening.Plugins.Core; using DG.Tweening.Plugins.Options; using UnityEngine; @@ -71,7 +72,7 @@ namespace DG.Tweening.Plugins return diag / unitsXSecond; } - public override void EvaluateAndApply(RectOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, Rect startValue, Rect changeValue, float duration, bool usingInversePosition) + public override void EvaluateAndApply(RectOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, Rect startValue, Rect changeValue, float duration, bool usingInversePosition, UpdateNotice updateNotice) { if (t.loopType == LoopType.Incremental) { int iterations = t.isComplete ? t.completedLoops - 1 : t.completedLoops; diff --git a/_DOTween.Assembly/DOTween/Plugins/StringPlugin.cs b/_DOTween.Assembly/DOTween/Plugins/StringPlugin.cs index 15e273f..1387b89 100644 --- a/_DOTween.Assembly/DOTween/Plugins/StringPlugin.cs +++ b/_DOTween.Assembly/DOTween/Plugins/StringPlugin.cs @@ -10,6 +10,7 @@ using System.Text; using System.Text.RegularExpressions; using DG.Tweening.Core; using DG.Tweening.Core.Easing; +using DG.Tweening.Core.Enums; using DG.Tweening.Plugins.Core; using DG.Tweening.Plugins.Options; using UnityEngine; @@ -64,7 +65,7 @@ namespace DG.Tweening.Plugins } // ChangeValue is the same as endValue in this plugin - public override void EvaluateAndApply(StringOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, string startValue, string changeValue, float duration, bool usingInversePosition) + public override void EvaluateAndApply(StringOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, string startValue, string changeValue, float duration, bool usingInversePosition, UpdateNotice updateNotice) { _Buffer.Remove(0, _Buffer.Length); diff --git a/_DOTween.Assembly/DOTween/Plugins/UintPlugin.cs b/_DOTween.Assembly/DOTween/Plugins/UintPlugin.cs index 2772f46..2dd6311 100644 --- a/_DOTween.Assembly/DOTween/Plugins/UintPlugin.cs +++ b/_DOTween.Assembly/DOTween/Plugins/UintPlugin.cs @@ -7,6 +7,7 @@ using System; using DG.Tweening.Core; using DG.Tweening.Core.Easing; +using DG.Tweening.Core.Enums; using DG.Tweening.Plugins.Core; using DG.Tweening.Plugins.Options; @@ -47,7 +48,7 @@ namespace DG.Tweening.Plugins return res; } - public override void EvaluateAndApply(NoOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, uint startValue, uint changeValue, float duration, bool usingInversePosition) + public override void EvaluateAndApply(NoOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, uint startValue, uint changeValue, float duration, bool usingInversePosition, UpdateNotice updateNotice) { if (t.loopType == LoopType.Incremental) startValue += (uint)(changeValue * (t.isComplete ? t.completedLoops - 1 : t.completedLoops)); if (t.isSequenced && t.sequenceParent.loopType == LoopType.Incremental) { diff --git a/_DOTween.Assembly/DOTween/Plugins/UlongPlugin.cs b/_DOTween.Assembly/DOTween/Plugins/UlongPlugin.cs index 7e461ec..e8d9a39 100644 --- a/_DOTween.Assembly/DOTween/Plugins/UlongPlugin.cs +++ b/_DOTween.Assembly/DOTween/Plugins/UlongPlugin.cs @@ -4,6 +4,7 @@ using System; using DG.Tweening.Core; using DG.Tweening.Core.Easing; +using DG.Tweening.Core.Enums; using DG.Tweening.Plugins.Core; using DG.Tweening.Plugins.Options; using UnityEngine; @@ -45,7 +46,7 @@ namespace DG.Tweening.Plugins return res; } - public override void EvaluateAndApply(NoOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, ulong startValue, ulong changeValue, float duration, bool usingInversePosition) + public override void EvaluateAndApply(NoOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter 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) { diff --git a/_DOTween.Assembly/DOTween/Plugins/Vector2Plugin.cs b/_DOTween.Assembly/DOTween/Plugins/Vector2Plugin.cs index 4996e53..5117220 100644 --- a/_DOTween.Assembly/DOTween/Plugins/Vector2Plugin.cs +++ b/_DOTween.Assembly/DOTween/Plugins/Vector2Plugin.cs @@ -8,6 +8,7 @@ using System; using DG.Tweening.Core; using DG.Tweening.Core.Easing; +using DG.Tweening.Core.Enums; using DG.Tweening.Plugins.Core; using DG.Tweening.Plugins.Options; using UnityEngine; @@ -73,7 +74,7 @@ namespace DG.Tweening.Plugins return changeValue.magnitude / unitsXSecond; } - public override void EvaluateAndApply(VectorOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, Vector2 startValue, Vector2 changeValue, float duration, bool usingInversePosition) + public override void EvaluateAndApply(VectorOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter 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) { diff --git a/_DOTween.Assembly/DOTween/Plugins/Vector2WrapperPlugin.cs b/_DOTween.Assembly/DOTween/Plugins/Vector2WrapperPlugin.cs index a80e220..afbbee6 100644 --- a/_DOTween.Assembly/DOTween/Plugins/Vector2WrapperPlugin.cs +++ b/_DOTween.Assembly/DOTween/Plugins/Vector2WrapperPlugin.cs @@ -5,6 +5,7 @@ using System; using DG.Tweening.Core; using DG.Tweening.Core.Easing; +using DG.Tweening.Core.Enums; using DG.Tweening.Core.Surrogates; using DG.Tweening.Plugins.Core; using DG.Tweening.Plugins.Options; @@ -71,7 +72,7 @@ namespace DG.Tweening.Plugins return changeValue.value.magnitude / unitsXSecond; } - public override void EvaluateAndApply(VectorOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, Vector2Wrapper startValue, Vector2Wrapper changeValue, float duration, bool usingInversePosition) + public override void EvaluateAndApply(VectorOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, Vector2Wrapper startValue, Vector2Wrapper changeValue, float duration, bool usingInversePosition, UpdateNotice updateNotice) { if (t.loopType == LoopType.Incremental) startValue.value += changeValue.value * (t.isComplete ? t.completedLoops - 1 : t.completedLoops); if (t.isSequenced && t.sequenceParent.loopType == LoopType.Incremental) { diff --git a/_DOTween.Assembly/DOTween/Plugins/Vector3ArrayPlugin.cs b/_DOTween.Assembly/DOTween/Plugins/Vector3ArrayPlugin.cs index 654f7ff..07fd672 100644 --- a/_DOTween.Assembly/DOTween/Plugins/Vector3ArrayPlugin.cs +++ b/_DOTween.Assembly/DOTween/Plugins/Vector3ArrayPlugin.cs @@ -7,6 +7,7 @@ using System; using DG.Tweening.Core; using DG.Tweening.Core.Easing; +using DG.Tweening.Core.Enums; using DG.Tweening.Plugins.Core; using DG.Tweening.Plugins.Options; using UnityEngine; @@ -65,7 +66,7 @@ namespace DG.Tweening.Plugins return totDuration; } - public override void EvaluateAndApply(Vector3ArrayOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, Vector3[] startValue, Vector3[] changeValue, float duration, bool usingInversePosition) + public override void EvaluateAndApply(Vector3ArrayOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, Vector3[] startValue, Vector3[] changeValue, float duration, bool usingInversePosition, UpdateNotice updateNotice) { Vector3 incrementValue = Vector3.zero; if (t.loopType == LoopType.Incremental) { diff --git a/_DOTween.Assembly/DOTween/Plugins/Vector3Plugin.cs b/_DOTween.Assembly/DOTween/Plugins/Vector3Plugin.cs index bb906b4..96565b9 100644 --- a/_DOTween.Assembly/DOTween/Plugins/Vector3Plugin.cs +++ b/_DOTween.Assembly/DOTween/Plugins/Vector3Plugin.cs @@ -8,6 +8,7 @@ using System; using DG.Tweening.Core; using DG.Tweening.Core.Easing; +using DG.Tweening.Core.Enums; using DG.Tweening.Plugins.Core; using DG.Tweening.Plugins.Options; using UnityEngine; @@ -80,7 +81,7 @@ namespace DG.Tweening.Plugins return changeValue.magnitude / unitsXSecond; } - public override void EvaluateAndApply(VectorOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, Vector3 startValue, Vector3 changeValue, float duration, bool usingInversePosition) + public override void EvaluateAndApply(VectorOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, Vector3 startValue, Vector3 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) { diff --git a/_DOTween.Assembly/DOTween/Plugins/Vector3WrapperPlugin.cs b/_DOTween.Assembly/DOTween/Plugins/Vector3WrapperPlugin.cs index 815a214..364aeaa 100644 --- a/_DOTween.Assembly/DOTween/Plugins/Vector3WrapperPlugin.cs +++ b/_DOTween.Assembly/DOTween/Plugins/Vector3WrapperPlugin.cs @@ -5,6 +5,7 @@ using System; using DG.Tweening.Core; using DG.Tweening.Core.Easing; +using DG.Tweening.Core.Enums; using DG.Tweening.Core.Surrogates; using DG.Tweening.Plugins.Core; using DG.Tweening.Plugins.Options; @@ -78,7 +79,7 @@ namespace DG.Tweening.Plugins return changeValue.value.magnitude / unitsXSecond; } - public override void EvaluateAndApply(VectorOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, Vector3Wrapper startValue, Vector3Wrapper changeValue, float duration, bool usingInversePosition) + public override void EvaluateAndApply(VectorOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, Vector3Wrapper startValue, Vector3Wrapper changeValue, float duration, bool usingInversePosition, UpdateNotice updateNotice) { if (t.loopType == LoopType.Incremental) startValue.value += changeValue.value * (t.isComplete ? t.completedLoops - 1 : t.completedLoops); if (t.isSequenced && t.sequenceParent.loopType == LoopType.Incremental) { diff --git a/_DOTween.Assembly/DOTween/Plugins/Vector4Plugin.cs b/_DOTween.Assembly/DOTween/Plugins/Vector4Plugin.cs index 2d7eb14..58450d5 100644 --- a/_DOTween.Assembly/DOTween/Plugins/Vector4Plugin.cs +++ b/_DOTween.Assembly/DOTween/Plugins/Vector4Plugin.cs @@ -8,6 +8,7 @@ using System; using DG.Tweening.Core; using DG.Tweening.Core.Easing; +using DG.Tweening.Core.Enums; using DG.Tweening.Plugins.Core; using DG.Tweening.Plugins.Options; using UnityEngine; @@ -87,7 +88,7 @@ namespace DG.Tweening.Plugins return changeValue.magnitude / unitsXSecond; } - public override void EvaluateAndApply(VectorOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, Vector4 startValue, Vector4 changeValue, float duration, bool usingInversePosition) + public override void EvaluateAndApply(VectorOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, Vector4 startValue, Vector4 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) { diff --git a/_DOTween.Assembly/DOTween/Plugins/Vector4WrapperPlugin.cs b/_DOTween.Assembly/DOTween/Plugins/Vector4WrapperPlugin.cs index 59e096a..f4da23b 100644 --- a/_DOTween.Assembly/DOTween/Plugins/Vector4WrapperPlugin.cs +++ b/_DOTween.Assembly/DOTween/Plugins/Vector4WrapperPlugin.cs @@ -4,6 +4,7 @@ using System; using DG.Tweening.Core; using DG.Tweening.Core.Easing; +using DG.Tweening.Core.Enums; using DG.Tweening.Core.Surrogates; using DG.Tweening.Plugins.Core; using DG.Tweening.Plugins.Options; @@ -84,7 +85,7 @@ namespace DG.Tweening.Plugins return changeValue.value.magnitude / unitsXSecond; } - public override void EvaluateAndApply(VectorOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, Vector4Wrapper startValue, Vector4Wrapper changeValue, float duration, bool usingInversePosition) + public override void EvaluateAndApply(VectorOptions options, Tween t, bool isRelative, DOGetter getter, DOSetter setter, float elapsed, Vector4Wrapper startValue, Vector4Wrapper changeValue, float duration, bool usingInversePosition, UpdateNotice updateNotice) { if (t.loopType == LoopType.Incremental) startValue.value += changeValue.value * (t.isComplete ? t.completedLoops - 1 : t.completedLoops); if (t.isSequenced && t.sequenceParent.loopType == LoopType.Incremental) { diff --git a/_DOTween.Assembly/DOTween/Sequence.cs b/_DOTween.Assembly/DOTween/Sequence.cs index f83b689..6a55400 100644 --- a/_DOTween.Assembly/DOTween/Sequence.cs +++ b/_DOTween.Assembly/DOTween/Sequence.cs @@ -134,7 +134,7 @@ namespace DG.Tweening return DoStartup(this); } - internal override bool ApplyTween(float prevPosition, int prevCompletedLoops, int newCompletedSteps, bool useInversePosition, UpdateMode updateMode) + internal override bool ApplyTween(float prevPosition, int prevCompletedLoops, int newCompletedSteps, bool useInversePosition, UpdateMode updateMode, UpdateNotice updateNotice) { return DoApplyTween(this, prevPosition, prevCompletedLoops, newCompletedSteps, useInversePosition, updateMode); } diff --git a/_DOTween.Assembly/DOTween/Tween.cs b/_DOTween.Assembly/DOTween/Tween.cs index ec82e7e..38ad404 100644 --- a/_DOTween.Assembly/DOTween/Tween.cs +++ b/_DOTween.Assembly/DOTween/Tween.cs @@ -163,8 +163,9 @@ namespace DG.Tweening internal abstract bool Startup(); // Applies the tween set by DoGoto. - // Returns TRUE if the tween needs to be killed - internal abstract bool ApplyTween(float prevPosition, int prevCompletedLoops, int newCompletedSteps, bool useInversePosition, UpdateMode updateMode); + // Returns TRUE if the tween needs to be killed. + // UpdateNotice is only used by Tweeners, since Sequences re-evaluate for it + internal abstract bool ApplyTween(float prevPosition, int prevCompletedLoops, int newCompletedSteps, bool useInversePosition, UpdateMode updateMode, UpdateNotice updateNotice); #endregion @@ -231,7 +232,10 @@ namespace DG.Tweening && (t.position < t.duration ? t.completedLoops % 2 != 0 : t.completedLoops % 2 == 0); // Get values from plugin and set them - if (t.ApplyTween(prevPosition, prevCompletedLoops, newCompletedSteps, useInversePosition, updateMode)) return true; + UpdateNotice updateNotice = + !wasRewinded && (t.loopType == LoopType.Restart && t.completedLoops != prevCompletedLoops || t.position <= 0 && t.completedLoops <= 0) + ? UpdateNotice.RewindStep : UpdateNotice.None; + if (t.ApplyTween(prevPosition, prevCompletedLoops, newCompletedSteps, useInversePosition, updateMode, updateNotice)) return true; // Additional callbacks if (t.onUpdate != null && updateMode != UpdateMode.IgnoreOnUpdate) { diff --git a/_DOTween.Assembly/bin/DOTween.XML b/_DOTween.Assembly/bin/DOTween.XML index 966f1e4..dfd017b 100644 --- a/_DOTween.Assembly/bin/DOTween.XML +++ b/_DOTween.Assembly/bin/DOTween.XML @@ -2187,5 +2187,21 @@ Public only so custom shortcuts can access some of these methods + + + Additional notices passed to plugins when updating. + Public so it can be used by custom plugins. Internally, only PathPlugin uses it + + + + + None + + + + + Lets the plugin know that we restarted or rewinded + + diff --git a/_DOTween.Assembly/bin/DOTween.dll b/_DOTween.Assembly/bin/DOTween.dll index 138b049..bdfe025 100644 Binary files a/_DOTween.Assembly/bin/DOTween.dll and b/_DOTween.Assembly/bin/DOTween.dll differ diff --git a/_DOTween.Assembly/bin/DOTween.dll.mdb b/_DOTween.Assembly/bin/DOTween.dll.mdb index d317e49..1872d90 100644 Binary files a/_DOTween.Assembly/bin/DOTween.dll.mdb and b/_DOTween.Assembly/bin/DOTween.dll.mdb differ diff --git a/_DOTween.Assembly/bin/DOTween43.dll b/_DOTween.Assembly/bin/DOTween43.dll index e0f10e5..ea46240 100644 Binary files a/_DOTween.Assembly/bin/DOTween43.dll and b/_DOTween.Assembly/bin/DOTween43.dll differ diff --git a/_DOTween.Assembly/bin/DOTween43.dll.mdb b/_DOTween.Assembly/bin/DOTween43.dll.mdb index 3566f4f..511036e 100644 Binary files a/_DOTween.Assembly/bin/DOTween43.dll.mdb and b/_DOTween.Assembly/bin/DOTween43.dll.mdb differ diff --git a/_DOTween.Assembly/bin/DOTween46.dll b/_DOTween.Assembly/bin/DOTween46.dll index 1c114c4..707b6ab 100644 Binary files a/_DOTween.Assembly/bin/DOTween46.dll and b/_DOTween.Assembly/bin/DOTween46.dll differ diff --git a/_DOTween.Assembly/bin/DOTween46.dll.mdb b/_DOTween.Assembly/bin/DOTween46.dll.mdb index d9fc32a..3e8cb06 100644 Binary files a/_DOTween.Assembly/bin/DOTween46.dll.mdb and b/_DOTween.Assembly/bin/DOTween46.dll.mdb differ diff --git a/_DOTween.Assembly/bin/DOTween50.dll b/_DOTween.Assembly/bin/DOTween50.dll index 7ceefb0..5af8dd1 100644 Binary files a/_DOTween.Assembly/bin/DOTween50.dll and b/_DOTween.Assembly/bin/DOTween50.dll differ diff --git a/_DOTween.Assembly/bin/DOTween50.dll.mdb b/_DOTween.Assembly/bin/DOTween50.dll.mdb index a6058f9..0b67c99 100644 Binary files a/_DOTween.Assembly/bin/DOTween50.dll.mdb and b/_DOTween.Assembly/bin/DOTween50.dll.mdb differ diff --git a/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll b/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll index 1dd974d..4516ae5 100644 Binary files a/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll and b/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll differ diff --git a/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll.mdb b/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll.mdb index 27af835..f2e13ac 100644 Binary files a/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll.mdb and b/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll.mdb differ