diff --git a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.XML b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.XML index 246e890..a5bf5ff 100644 --- a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.XML +++ b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.XML @@ -662,12 +662,16 @@ Restarts all tweens, then returns the number of actual tweens restarted - + Restarts all tweens with the given ID or target, then returns the number of actual tweens restarted + If TRUE includes the eventual tweens delays, otherwise skips them + If >= 0 changes the startup delay of all involved tweens to this value, otherwise doesn't touch it - + Restarts all tweens with the given target and the given ID, and returns the number of actual tweens played (meaning the tweens that were not already playing or complete) + If TRUE includes the eventual tweens delays, otherwise skips them + If >= 0 changes the startup delay of all involved tweens to this value, otherwise doesn't touch it Rewinds and pauses all tweens, then returns the number of actual tweens rewinded @@ -1020,9 +1024,10 @@ Sets the tween in a forward direction and plays it - + Restarts the tween from the beginning If TRUE includes the eventual tween delay, otherwise skips it + If >= 0 changes the startup delay to this value, otherwise doesn't touch it Rewinds and pauses the tween diff --git a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.dll b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.dll index e2ddb50..e37098e 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 5ed9f0f..0085f26 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 11a9895..5d983d7 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 ce7c139..dc7279e 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 0212612..af0f241 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 8e05d76..3a6fa6d 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 a225f32..f548821 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 614556b..aafce0d 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 5f2e2b6..dcec7c8 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 dc943cc..943014e 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 246e890..a5bf5ff 100644 --- a/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween.XML +++ b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween.XML @@ -662,12 +662,16 @@ Restarts all tweens, then returns the number of actual tweens restarted - + Restarts all tweens with the given ID or target, then returns the number of actual tweens restarted + If TRUE includes the eventual tweens delays, otherwise skips them + If >= 0 changes the startup delay of all involved tweens to this value, otherwise doesn't touch it - + Restarts all tweens with the given target and the given ID, and returns the number of actual tweens played (meaning the tweens that were not already playing or complete) + If TRUE includes the eventual tweens delays, otherwise skips them + If >= 0 changes the startup delay of all involved tweens to this value, otherwise doesn't touch it Rewinds and pauses all tweens, then returns the number of actual tweens rewinded @@ -1020,9 +1024,10 @@ Sets the tween in a forward direction and plays it - + Restarts the tween from the beginning If TRUE includes the eventual tween delay, otherwise skips it + If >= 0 changes the startup delay to this value, otherwise doesn't touch it Rewinds and pauses the tween diff --git a/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween.dll b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween.dll index e2ddb50..e37098e 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 5ed9f0f..0085f26 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 11a9895..5d983d7 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 ce7c139..dc7279e 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 0212612..af0f241 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 8e05d76..3a6fa6d 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 a225f32..f548821 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 614556b..aafce0d 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 5f2e2b6..dcec7c8 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 dc943cc..943014e 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 246e890..a5bf5ff 100644 --- a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.XML +++ b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.XML @@ -662,12 +662,16 @@ Restarts all tweens, then returns the number of actual tweens restarted - + Restarts all tweens with the given ID or target, then returns the number of actual tweens restarted + If TRUE includes the eventual tweens delays, otherwise skips them + If >= 0 changes the startup delay of all involved tweens to this value, otherwise doesn't touch it - + Restarts all tweens with the given target and the given ID, and returns the number of actual tweens played (meaning the tweens that were not already playing or complete) + If TRUE includes the eventual tweens delays, otherwise skips them + If >= 0 changes the startup delay of all involved tweens to this value, otherwise doesn't touch it Rewinds and pauses all tweens, then returns the number of actual tweens rewinded @@ -1020,9 +1024,10 @@ Sets the tween in a forward direction and plays it - + Restarts the tween from the beginning If TRUE includes the eventual tween delay, otherwise skips it + If >= 0 changes the startup delay to this value, otherwise doesn't touch it Rewinds and pauses the tween diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll index e2ddb50..e37098e 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 5ed9f0f..0085f26 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 11a9895..5d983d7 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 ce7c139..dc7279e 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 0212612..af0f241 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 8e05d76..3a6fa6d 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 a225f32..f548821 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 614556b..aafce0d 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 5f2e2b6..dcec7c8 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 dc943cc..943014e 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 PRO/TempPro.cs b/UnityTests.Unity5/Assets/_Tests PRO/TempPro.cs index 56b1400..3f801e3 100644 --- a/UnityTests.Unity5/Assets/_Tests PRO/TempPro.cs +++ b/UnityTests.Unity5/Assets/_Tests PRO/TempPro.cs @@ -5,15 +5,23 @@ using DG.Tweening; public class TempPro : MonoBehaviour { - public Transform target; + public DOTweenPath target; - void Start () - { - target.DOMoveX(3, 1).OnComplete(TempPro.OnCompleteCallback); - } + IEnumerator Start() + { + Tween t = this.transform.DOMoveX(2, 2).OnRewind(()=> Debug.Log("Rewind 0")); + yield return new WaitForSeconds(1); + t.Rewind(); + // target.GetTween().Rewind(); + } - public static void OnCompleteCallback() + public void OnComplete() + { + Debug.Log("COMPLETE"); + } + + public void OnRewind() { - Debug.Log("Hello I'm public! And Static! Love me!"); + Debug.Log("REWIND"); } } \ No newline at end of file diff --git a/UnityTests.Unity5/Assets/_Tests PRO/TempPro.unity b/UnityTests.Unity5/Assets/_Tests PRO/TempPro.unity index cb74aec..52ced61 100644 Binary files a/UnityTests.Unity5/Assets/_Tests PRO/TempPro.unity and b/UnityTests.Unity5/Assets/_Tests PRO/TempPro.unity differ diff --git a/UnityTests.Unity5/Assets/_Tests/RestartAndChangeDelay.cs b/UnityTests.Unity5/Assets/_Tests/RestartAndChangeDelay.cs new file mode 100644 index 0000000..35bd404 --- /dev/null +++ b/UnityTests.Unity5/Assets/_Tests/RestartAndChangeDelay.cs @@ -0,0 +1,28 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using DG.Tweening; + +public class RestartAndChangeDelay : BrainBase +{ + public Transform target; + + Tween tween; + + void Start() + { + tween = target.DOMoveX(2, 1).SetDelay(2).SetAutoKill(false) + .OnPlay(()=> Debug.Log("Play")); + } + + public void Restart(float delay) + { + Debug.Log("Restart"); + tween.Restart(true, delay); + } + public void Restart() + { + Debug.Log("Restart"); + tween.Restart(); + } +} \ No newline at end of file diff --git a/UnityTests.Unity5/Assets/_Tests/RestartAndChangeDelay.cs.meta b/UnityTests.Unity5/Assets/_Tests/RestartAndChangeDelay.cs.meta new file mode 100644 index 0000000..18779fd --- /dev/null +++ b/UnityTests.Unity5/Assets/_Tests/RestartAndChangeDelay.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 64c657372e0ab45408b6f9684c9703aa +timeCreated: 1487498114 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityTests.Unity5/Assets/_Tests/RestartAndChangeDelay.unity b/UnityTests.Unity5/Assets/_Tests/RestartAndChangeDelay.unity new file mode 100644 index 0000000..67b48b0 Binary files /dev/null and b/UnityTests.Unity5/Assets/_Tests/RestartAndChangeDelay.unity differ diff --git a/UnityTests.Unity5/Assets/_Tests/RestartAndChangeDelay.unity.meta b/UnityTests.Unity5/Assets/_Tests/RestartAndChangeDelay.unity.meta new file mode 100644 index 0000000..16a20ed --- /dev/null +++ b/UnityTests.Unity5/Assets/_Tests/RestartAndChangeDelay.unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d252004f1d313fe448a64fff6db34230 +timeCreated: 1487498101 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/_DOTween.Assembly/DOTween/Core/TweenManager.cs b/_DOTween.Assembly/DOTween/Core/TweenManager.cs index 136b709..eb8bc77 100644 --- a/_DOTween.Assembly/DOTween/Core/TweenManager.cs +++ b/_DOTween.Assembly/DOTween/Core/TweenManager.cs @@ -510,7 +510,7 @@ namespace DG.Tweening.Core if (PlayForward(t)) totInvolved++; break; case OperationType.Restart: - if (Restart(t, optionalBool)) totInvolved++; + if (Restart(t, optionalBool, optionalFloat)) totInvolved++; break; case OperationType.Rewind: if (Rewind(t, optionalBool)) totInvolved++; @@ -641,10 +641,11 @@ namespace DG.Tweening.Core return Play(t); } - internal static bool Restart(Tween t, bool includeDelay = true) + internal static bool Restart(Tween t, bool includeDelay = true, float changeDelayTo = -1) { bool wasPaused = !t.isPlaying; t.isBackwards = false; + if (changeDelayTo >= 0) t.delay = changeDelayTo; Rewind(t, includeDelay); t.isPlaying = true; if (wasPaused && t.playedOnce && t.delayComplete && t.onPlay != null) { diff --git a/_DOTween.Assembly/DOTween/DOTween.cs b/_DOTween.Assembly/DOTween/DOTween.cs index fbc8041..9ce935a 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.1.560"; + public static readonly string Version = "1.1.570"; /////////////////////////////////////////////// // Options //////////////////////////////////// @@ -816,17 +816,21 @@ namespace DG.Tweening return TweenManager.FilteredOperation(OperationType.Restart, FilterType.All, null, includeDelay, 0); } /// Restarts all tweens with the given ID or target, then returns the number of actual tweens restarted - public static int Restart(object targetOrId, bool includeDelay = true) + /// If TRUE includes the eventual tweens delays, otherwise skips them + /// If >= 0 changes the startup delay of all involved tweens to this value, otherwise doesn't touch it + public static int Restart(object targetOrId, bool includeDelay = true, float changeDelayTo = -1) { if (targetOrId == null) return 0; - return TweenManager.FilteredOperation(OperationType.Restart, FilterType.TargetOrId, targetOrId, includeDelay, 0); + return TweenManager.FilteredOperation(OperationType.Restart, FilterType.TargetOrId, targetOrId, includeDelay, changeDelayTo); } /// Restarts all tweens with the given target and the given ID, and returns the number of actual tweens played /// (meaning the tweens that were not already playing or complete) - public static int Restart(object target, object id, bool includeDelay = true) + /// If TRUE includes the eventual tweens delays, otherwise skips them + /// If >= 0 changes the startup delay of all involved tweens to this value, otherwise doesn't touch it + public static int Restart(object target, object id, bool includeDelay = true, float changeDelayTo = -1) { if (target == null || id == null) return 0; - return TweenManager.FilteredOperation(OperationType.Restart, FilterType.TargetAndId, id, includeDelay, 0, target); + return TweenManager.FilteredOperation(OperationType.Restart, FilterType.TargetAndId, id, includeDelay, changeDelayTo, target); } /// Rewinds and pauses all tweens, then returns the number of actual tweens rewinded diff --git a/_DOTween.Assembly/DOTween/TweenExtensions.cs b/_DOTween.Assembly/DOTween/TweenExtensions.cs index 148ee0d..591d47b 100644 --- a/_DOTween.Assembly/DOTween/TweenExtensions.cs +++ b/_DOTween.Assembly/DOTween/TweenExtensions.cs @@ -187,7 +187,8 @@ namespace DG.Tweening /// Restarts the tween from the beginning /// If TRUE includes the eventual tween delay, otherwise skips it - public static void Restart(this Tween t, bool includeDelay = true) + /// If >= 0 changes the startup delay to this value, otherwise doesn't touch it + public static void Restart(this Tween t, bool includeDelay = true, float changeDelayTo = -1) { if (t == null) { if (Debugger.logPriority > 1) Debugger.LogNullTween(t); return; @@ -197,7 +198,7 @@ namespace DG.Tweening if (Debugger.logPriority > 1) Debugger.LogNestedTween(t); return; } - TweenManager.Restart(t, includeDelay); + TweenManager.Restart(t, includeDelay, changeDelayTo); } /// Rewinds and pauses the tween diff --git a/_DOTween.Assembly/bin/DOTween.XML b/_DOTween.Assembly/bin/DOTween.XML index 246e890..a5bf5ff 100644 --- a/_DOTween.Assembly/bin/DOTween.XML +++ b/_DOTween.Assembly/bin/DOTween.XML @@ -662,12 +662,16 @@ Restarts all tweens, then returns the number of actual tweens restarted - + Restarts all tweens with the given ID or target, then returns the number of actual tweens restarted + If TRUE includes the eventual tweens delays, otherwise skips them + If >= 0 changes the startup delay of all involved tweens to this value, otherwise doesn't touch it - + Restarts all tweens with the given target and the given ID, and returns the number of actual tweens played (meaning the tweens that were not already playing or complete) + If TRUE includes the eventual tweens delays, otherwise skips them + If >= 0 changes the startup delay of all involved tweens to this value, otherwise doesn't touch it Rewinds and pauses all tweens, then returns the number of actual tweens rewinded @@ -1020,9 +1024,10 @@ Sets the tween in a forward direction and plays it - + Restarts the tween from the beginning If TRUE includes the eventual tween delay, otherwise skips it + If >= 0 changes the startup delay to this value, otherwise doesn't touch it Rewinds and pauses the tween diff --git a/_DOTween.Assembly/bin/DOTween.dll b/_DOTween.Assembly/bin/DOTween.dll index e2ddb50..e37098e 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 5ed9f0f..0085f26 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 11a9895..5d983d7 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 ce7c139..dc7279e 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 0212612..af0f241 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 8e05d76..3a6fa6d 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 a225f32..f548821 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 614556b..aafce0d 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 5f2e2b6..dcec7c8 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 dc943cc..943014e 100644 Binary files a/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll.mdb and b/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll.mdb differ