diff --git a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.dll b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.dll index 0b2bf0c..8ee212e 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 fea9f7e..ae3ae30 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/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween.dll b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween.dll index 0b2bf0c..8ee212e 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 fea9f7e..ae3ae30 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.Unity5/Assets/Demigiant/DOTween/DOTween.dll b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll index 0b2bf0c..8ee212e 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 fea9f7e..ae3ae30 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/_Tests/Bugs/NestedSequencesCallbacks.cs b/UnityTests.Unity5/Assets/_Tests/Bugs/NestedSequencesCallbacks.cs new file mode 100644 index 0000000..d5bc29c --- /dev/null +++ b/UnityTests.Unity5/Assets/_Tests/Bugs/NestedSequencesCallbacks.cs @@ -0,0 +1,29 @@ +using UnityEngine; +using System.Collections; +using DG.Tweening; + +public class NestedSequencesCallbacks : BrainBase +{ + public Transform target; + int count; + + void Start() + { + int loops = 10; + DOTween.Sequence() + // .Append(DOTween.Sequence() + // .InsertCallback(0.0000001f, ()=> Debug.Log("Nested Sequence callback")) + // // .AppendInterval(0.5f) + // .SetLoops(10) + // ) + .Append( + target.DOMoveX(3, 0.0000001f) + .SetLoops(loops) + .OnStepComplete(()=> { + count++; + Debug.Log("Nested Tween callback " + count + "/" + loops); + }) + ) + .OnComplete(()=> Debug.Log("Sequence complete")); + } +} \ No newline at end of file diff --git a/UnityTests.Unity5/Assets/_Tests/Bugs/NestedSequencesCallbacks.cs.meta b/UnityTests.Unity5/Assets/_Tests/Bugs/NestedSequencesCallbacks.cs.meta new file mode 100644 index 0000000..50a6cc0 --- /dev/null +++ b/UnityTests.Unity5/Assets/_Tests/Bugs/NestedSequencesCallbacks.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2026035b2228bda46b704e0066c412c8 +timeCreated: 1427197908 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityTests.Unity5/Assets/_Tests/Bugs/NestedSequencesCallbacks.unity b/UnityTests.Unity5/Assets/_Tests/Bugs/NestedSequencesCallbacks.unity new file mode 100644 index 0000000..e9848db Binary files /dev/null and b/UnityTests.Unity5/Assets/_Tests/Bugs/NestedSequencesCallbacks.unity differ diff --git a/UnityTests.Unity5/Assets/_Tests/Bugs/NestedSequencesCallbacks.unity.meta b/UnityTests.Unity5/Assets/_Tests/Bugs/NestedSequencesCallbacks.unity.meta new file mode 100644 index 0000000..9395beb --- /dev/null +++ b/UnityTests.Unity5/Assets/_Tests/Bugs/NestedSequencesCallbacks.unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 66ec0ed6383df9f4691a2baa8f042412 +timeCreated: 1427197899 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityTests.Unity5/Assets/_Tests/Bugs/Temp.cs b/UnityTests.Unity5/Assets/_Tests/Bugs/Temp.cs index 5577656..cc4acd4 100644 --- a/UnityTests.Unity5/Assets/_Tests/Bugs/Temp.cs +++ b/UnityTests.Unity5/Assets/_Tests/Bugs/Temp.cs @@ -5,11 +5,20 @@ using System.Collections; public class Temp : BrainBase { - void Start() - { - Debug.Log("Creating empty sequences"); - for (int i = 0; i < 100; ++i) { - DOTween.Sequence(); - } - } + [SerializeField] + private Vector3 pos; + [SerializeField] + private float duration; + [SerializeField] + private GameObject goToMove; + + private Tweener moveTween; + + // Update is called once per frame + void Update() { + if(moveTween == null) { + moveTween = goToMove.transform.DOLocalMove(pos, duration).SetAutoKill(false); + } + moveTween.ChangeEndValue(pos, duration, true); + } } \ No newline at end of file diff --git a/UnityTests.Unity5/Assets/_Tests/Bugs/Temp.unity b/UnityTests.Unity5/Assets/_Tests/Bugs/Temp.unity index aa0b136..de4a611 100644 Binary files a/UnityTests.Unity5/Assets/_Tests/Bugs/Temp.unity and b/UnityTests.Unity5/Assets/_Tests/Bugs/Temp.unity differ diff --git a/UnityTests.Unity5/Assets/_Tests/EaseCurveSingle.cs b/UnityTests.Unity5/Assets/_Tests/EaseCurveSingle.cs new file mode 100644 index 0000000..5afdbb1 --- /dev/null +++ b/UnityTests.Unity5/Assets/_Tests/EaseCurveSingle.cs @@ -0,0 +1,17 @@ +using UnityEngine; +using System.Collections; +using System.Collections.Generic; +using DG.Tweening; + +public class EaseCurveSingle : MonoBehaviour +{ + public Transform[] targets; + + IEnumerator Start() + { + yield return new WaitForSeconds(1); + + targets[0].DOMoveX(6, 1.5f).SetEase(Ease.Linear).SetLoops(2, LoopType.Restart); + targets[1].DOMoveX(6, 1.5f).SetEase(Ease.Linear).SetLoops(2, LoopType.Yoyo); + } +} \ No newline at end of file diff --git a/UnityTests.Unity5/Assets/_Tests/EaseCurveSingle.cs.meta b/UnityTests.Unity5/Assets/_Tests/EaseCurveSingle.cs.meta new file mode 100644 index 0000000..defc953 --- /dev/null +++ b/UnityTests.Unity5/Assets/_Tests/EaseCurveSingle.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 6f35396bedd659d4fa5a98da4c0785d9 +timeCreated: 1427215378 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityTests.Unity5/Assets/_Tests/EaseCurveSingle.unity b/UnityTests.Unity5/Assets/_Tests/EaseCurveSingle.unity new file mode 100644 index 0000000..85af464 Binary files /dev/null and b/UnityTests.Unity5/Assets/_Tests/EaseCurveSingle.unity differ diff --git a/UnityTests.Unity5/Assets/_Tests/EaseCurveSingle.unity.meta b/UnityTests.Unity5/Assets/_Tests/EaseCurveSingle.unity.meta new file mode 100644 index 0000000..99268da --- /dev/null +++ b/UnityTests.Unity5/Assets/_Tests/EaseCurveSingle.unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a15076a6f2a5bbf48b1150b6e1006e4b +timeCreated: 1427215371 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityTests.Unity5/Assets/_Tests/TempTests.cs b/UnityTests.Unity5/Assets/_Tests/TempTests.cs index 03e2629..3a5f182 100644 --- a/UnityTests.Unity5/Assets/_Tests/TempTests.cs +++ b/UnityTests.Unity5/Assets/_Tests/TempTests.cs @@ -11,15 +11,16 @@ using System; public class TempTests : BrainBase { public Transform target; + public Vector3[] waypoints; IEnumerator Start() { yield return new WaitForSeconds(0.6f); - Tweener t = target.DOLocalMove(new Vector3(4, 4, 0), 3); + Tween t = target.DOPath(waypoints, 5); + yield return null; + yield return null; - yield return new WaitForSeconds(0.1f); - - t.ChangeEndValue(new Vector3(0, 8, 0)); + t.GotoWaypoint(2); } } \ No newline at end of file diff --git a/UnityTests.Unity5/Assets/_Tests/TempTests.unity b/UnityTests.Unity5/Assets/_Tests/TempTests.unity index 0ab0dc7..723dbd4 100644 Binary files a/UnityTests.Unity5/Assets/_Tests/TempTests.unity and b/UnityTests.Unity5/Assets/_Tests/TempTests.unity differ diff --git a/UnityTests.Unity5/Assets/_Tests/VirtualTweens.cs b/UnityTests.Unity5/Assets/_Tests/VirtualTweens.cs index 1995d4a..81ae943 100644 --- a/UnityTests.Unity5/Assets/_Tests/VirtualTweens.cs +++ b/UnityTests.Unity5/Assets/_Tests/VirtualTweens.cs @@ -4,13 +4,27 @@ using UnityEngine; public class VirtualTweens : BrainBase { + float sampleFloat; Vector3 vector = Vector3.zero; + float startupTime; + int delayedCalls; - void Start() + IEnumerator Start() { - DOVirtual.Float(0, 1, 3, UpdateCallback); + yield return new WaitForSeconds(1f); - DOVirtual.DelayedCall(2, ()=> Debug.Log("" + Time.realtimeSinceStartup + " > Wait call complete")); + // DOVirtual.Float(0, 1, 3, UpdateCallback); + + // DOVirtual.DelayedCall(2, ()=> Debug.Log("" + Time.realtimeSinceStartup + " > Wait call complete")); + + startupTime = Time.realtimeSinceStartup; + DOTween.Sequence() + .Append(DOVirtual.DelayedCall(0.2f, RepeatCallback).SetLoops(10)) + .SetEase(Ease.OutQuint); + // DOTween.Sequence() + // .Append( + // DOVirtual.DelayedCall(0.2f, RepeatCallback).SetLoops(10) + // ); } void UpdateCallback(float val) @@ -19,4 +33,10 @@ public class VirtualTweens : BrainBase vector.y = DOVirtual.EasedValue(15, 100, val, Ease.OutQuad); Debug.Log(vector); } + + void RepeatCallback() + { + delayedCalls++; + Debug.Log("" + (Time.realtimeSinceStartup - startupTime) + " > DELAYED CALL " + delayedCalls + ""); + } } \ No newline at end of file diff --git a/UnityTests.Unity5/Assets/_Tests/_Shared Materials/Flat MAT 01.mat b/UnityTests.Unity5/Assets/_Tests/_Shared Materials/Flat MAT 01.mat new file mode 100644 index 0000000..90ca9b6 Binary files /dev/null and b/UnityTests.Unity5/Assets/_Tests/_Shared Materials/Flat MAT 01.mat differ diff --git a/UnityTests.Unity5/Assets/_Tests/_Shared Materials/Flat MAT 01.mat.meta b/UnityTests.Unity5/Assets/_Tests/_Shared Materials/Flat MAT 01.mat.meta new file mode 100644 index 0000000..866f27b --- /dev/null +++ b/UnityTests.Unity5/Assets/_Tests/_Shared Materials/Flat MAT 01.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e089f476aa726bd4ead5229bb0fe510b +timeCreated: 1427215444 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityTests.Unity5/Assets/_Tests/_Shared Prefabs/Sphere Flat.prefab b/UnityTests.Unity5/Assets/_Tests/_Shared Prefabs/Sphere Flat.prefab new file mode 100644 index 0000000..6785a4e Binary files /dev/null and b/UnityTests.Unity5/Assets/_Tests/_Shared Prefabs/Sphere Flat.prefab differ diff --git a/UnityTests.Unity5/Assets/_Tests/_Shared Prefabs/Sphere Flat.prefab.meta b/UnityTests.Unity5/Assets/_Tests/_Shared Prefabs/Sphere Flat.prefab.meta new file mode 100644 index 0000000..2546e05 --- /dev/null +++ b/UnityTests.Unity5/Assets/_Tests/_Shared Prefabs/Sphere Flat.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ed680544b35cdd649a53e76cb0af15d4 +timeCreated: 1427215436 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/_DOTween.Assembly/DOTween/Core/TweenManager.cs b/_DOTween.Assembly/DOTween/Core/TweenManager.cs index 9973fd4..f0b4890 100644 --- a/_DOTween.Assembly/DOTween/Core/TweenManager.cs +++ b/_DOTween.Assembly/DOTween/Core/TweenManager.cs @@ -534,7 +534,8 @@ namespace DG.Tweening.Core t.isPlaying = andPlay; t.delayComplete = true; t.elapsedDelay = t.delay; - int toCompletedLoops = (int)(to / t.duration); +// int toCompletedLoops = (int)(to / t.duration); // With very small floats creates floating points imprecisions + int toCompletedLoops = Mathf.FloorToInt(to / t.duration); // Takes care of floating points imprecision ((int)Math.Floot doesn't suffice) float toPosition = to % t.duration; if (t.loops != -1 && toCompletedLoops >= t.loops) { toCompletedLoops = t.loops; diff --git a/_DOTween.Assembly/DOTween/DOTween.cs b/_DOTween.Assembly/DOTween/DOTween.cs index f4b9f43..b089c77 100644 --- a/_DOTween.Assembly/DOTween/DOTween.cs +++ b/_DOTween.Assembly/DOTween/DOTween.cs @@ -21,7 +21,7 @@ namespace DG.Tweening public class DOTween { /// DOTween's version - public static readonly string Version = "1.0.340"; + public static readonly string Version = "1.0.345"; /////////////////////////////////////////////// // Options //////////////////////////////////// diff --git a/_DOTween.Assembly/DOTween/DOVirtual.cs b/_DOTween.Assembly/DOTween/DOVirtual.cs index ea08e27..22482be 100644 --- a/_DOTween.Assembly/DOTween/DOVirtual.cs +++ b/_DOTween.Assembly/DOTween/DOVirtual.cs @@ -80,7 +80,7 @@ namespace DG.Tweening /// If TRUE (default) ignores Unity's timeScale public static Tween DelayedCall(float delay, TweenCallback callback, bool ignoreTimeScale = true) { - return DOTween.Sequence().AppendInterval(delay).OnComplete(callback).SetUpdate(UpdateType.Normal, ignoreTimeScale).SetAutoKill(true); + return DOTween.Sequence().AppendInterval(delay).OnStepComplete(callback).SetUpdate(UpdateType.Normal, ignoreTimeScale).SetAutoKill(true); } #endregion diff --git a/_DOTween.Assembly/bin/DOTween.dll b/_DOTween.Assembly/bin/DOTween.dll index 0b2bf0c..8ee212e 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 fea9f7e..ae3ae30 100644 Binary files a/_DOTween.Assembly/bin/DOTween.dll.mdb and b/_DOTween.Assembly/bin/DOTween.dll.mdb differ