diff --git a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.dll b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.dll index a717f62..394269d 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 35b481d..953d7e2 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 a717f62..394269d 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 35b481d..953d7e2 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 a717f62..394269d 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 35b481d..953d7e2 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/LoopTypeRestart.cs b/UnityTests.Unity5/Assets/_Tests/Bugs/LoopTypeRestart.cs new file mode 100644 index 0000000..74b98de --- /dev/null +++ b/UnityTests.Unity5/Assets/_Tests/Bugs/LoopTypeRestart.cs @@ -0,0 +1,47 @@ +using UnityEngine; +using System.Collections; +using DG.Tweening; + +public class LoopTypeRestart : BrainBase +{ + public enum SequenceType + { + Test, + Bugged + } + public SequenceType sequencetype; + public bool initialInterval; + public bool midIntervals = true; + public LoopType loopType = LoopType.Restart; + public Transform target; + + IEnumerator Start() + { + yield return new WaitForSeconds(0.6f); + + Sequence s = DOTween.Sequence(); + s.SetLoops(-1, loopType); + + if (sequencetype == SequenceType.Bugged) { + if (initialInterval) s.AppendInterval(0.5f); + s.AppendCallback(()=> { + Debug.Log("Callback A"); + MoveSpriteToPoint(new Vector3(0, 0, 0)); + }); + if (midIntervals) s.AppendInterval(0.5f); + s.AppendCallback(()=> { + Debug.Log("Callback B"); + MoveSpriteToPoint(new Vector3(2, 0, 0)); + }); + if (midIntervals) s.AppendInterval(0.5f); + } else { + s.Append(target.DOMoveX(3, 0.5f)); + s.Append(target.DORotate(new Vector3(0, 180, 0), 0.5f)); + } + } + + void MoveSpriteToPoint(Vector3 destPos) + { + target.DOMove(destPos, 0.5f); + } +} \ No newline at end of file diff --git a/UnityTests.Unity5/Assets/_Tests/Bugs/LoopTypeRestart.cs.meta b/UnityTests.Unity5/Assets/_Tests/Bugs/LoopTypeRestart.cs.meta new file mode 100644 index 0000000..ef704ed --- /dev/null +++ b/UnityTests.Unity5/Assets/_Tests/Bugs/LoopTypeRestart.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c653f77de1feeea4ab81f7ba9737d3cc +timeCreated: 1428310452 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityTests.Unity5/Assets/_Tests/Bugs/LoopTypeRestart.unity b/UnityTests.Unity5/Assets/_Tests/Bugs/LoopTypeRestart.unity new file mode 100644 index 0000000..3ade9b8 Binary files /dev/null and b/UnityTests.Unity5/Assets/_Tests/Bugs/LoopTypeRestart.unity differ diff --git a/UnityTests.Unity5/Assets/_Tests/Bugs/LoopTypeRestart.unity.meta b/UnityTests.Unity5/Assets/_Tests/Bugs/LoopTypeRestart.unity.meta new file mode 100644 index 0000000..3a01439 --- /dev/null +++ b/UnityTests.Unity5/Assets/_Tests/Bugs/LoopTypeRestart.unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b788bdeb5ca734542ba694693885cdfe +timeCreated: 1428310441 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityTests.Unity5/Assets/_Tests/TempTests.unity b/UnityTests.Unity5/Assets/_Tests/TempTests.unity index 9a1d13d..cb2479d 100644 Binary files a/UnityTests.Unity5/Assets/_Tests/TempTests.unity and b/UnityTests.Unity5/Assets/_Tests/TempTests.unity differ diff --git a/_DOTween.Assembly/DOTween/DOTween.cs b/_DOTween.Assembly/DOTween/DOTween.cs index 24c56c9..f67a63d 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.435"; + public static readonly string Version = "1.0.437"; /////////////////////////////////////////////// // Options //////////////////////////////////// diff --git a/_DOTween.Assembly/DOTween/Sequence.cs b/_DOTween.Assembly/DOTween/Sequence.cs index 431a19a..4a1230c 100644 --- a/_DOTween.Assembly/DOTween/Sequence.cs +++ b/_DOTween.Assembly/DOTween/Sequence.cs @@ -188,8 +188,9 @@ namespace DG.Tweening if (s.isBackwards) prevPosIsInverse = !prevPosIsInverse; // Update multiple loop cycles within the same update if (newCompletedSteps > 0) { +// Debug.Log(Time.frameCount + " newCompletedSteps = " + newCompletedSteps + " - completedLoops: " + s.completedLoops + " - updateMode: " + updateMode); // Store expected completedLoops and position, in order to check them after the update cycles. - int expectedCompletedLoops = s.completedLoops + newCompletedSteps; + int expectedCompletedLoops = s.completedLoops; float expectedPosition = s.position; // int cycles = newCompletedSteps; @@ -206,6 +207,7 @@ namespace DG.Tweening if (s.loopType == LoopType.Yoyo) prevPosIsInverse = !prevPosIsInverse; } // If completedLoops or position were changed by some callback, exit here +// Debug.Log(" Internal Cycle Ended > expecteCompletedLoops/completedLoops: " + expectedCompletedLoops + "/" + s.completedLoops + " - expectedPosition/position: " + expectedPosition + "/" + s.position); if (expectedCompletedLoops != s.completedLoops || Math.Abs(expectedPosition - s.position) > Single.Epsilon) return !s.active; } else { // Simply determine correct prevPosition after steps @@ -233,7 +235,7 @@ namespace DG.Tweening static bool ApplyInternalCycle(Sequence s, float fromPos, float toPos, UpdateMode updateMode, bool useInverse, bool prevPosIsInverse, bool multiCycleStep = false) { bool isBackwardsUpdate = toPos < fromPos; -// Debug.Log(Time.frameCount + " " + s.id + " " + (multiCycleStep ? "Multicycle > " : "Cycle > ") + s.position + "/" + s.duration + " - s.isBackwards: " + s.isBackwards + ", useInverse/prevInverse: " + useInverse + "/" + prevPosIsInverse + " - " + fromPos + " > " + toPos + " - UpdateMode: " + updateMode + ", isPlaying: " + s.isPlaying); +// Debug.Log(Time.frameCount + " " + s.id + " " + (multiCycleStep ? "Multicycle > " : "Cycle > ") + s.position + "/" + s.duration + " - s.isBackwards: " + s.isBackwards + ", useInverse/prevInverse: " + useInverse + "/" + prevPosIsInverse + " - " + fromPos + " > " + toPos + " - UpdateMode: " + updateMode + ", isPlaying: " + s.isPlaying + ", completedLoops: " + s.completedLoops); if (isBackwardsUpdate) { int len = s._sequencedObjs.Count - 1; for (int i = len; i > -1; --i) { diff --git a/_DOTween.Assembly/bin/DOTween.dll b/_DOTween.Assembly/bin/DOTween.dll index a717f62..394269d 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 35b481d..953d7e2 100644 Binary files a/_DOTween.Assembly/bin/DOTween.dll.mdb and b/_DOTween.Assembly/bin/DOTween.dll.mdb differ