diff --git a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.dll b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.dll index 14f1da2..39fe03e 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 8a19802..3c3f66a 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 82779f1..17b117d 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 b5fb952..88d81a2 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 5c28caa..a41f7e7 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 ccbc878..a68e50f 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 7de640f..7f47f6d 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 754157a..33bdb38 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/DOTween50.xml b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween50.xml index 7952aa7..dda8e6b 100644 --- a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween50.xml +++ b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween50.xml @@ -108,5 +108,18 @@ and returns the total number of tweens involved. + + + Methods that extend Tween objects and allow to control or get data from them. + These require at least Unity 5.3 + + + + + Returns a that waits until the tween is killed or complete. + It can be used inside a coroutine as a yield. + Example usage:yield return myTween.WaitForCompletionCY(); + + diff --git a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll index 88419a0..1b20b39 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 916e1c1..5138403 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.dll b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween.dll index 14f1da2..39fe03e 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 8a19802..3c3f66a 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 82779f1..17b117d 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 b5fb952..88d81a2 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 5c28caa..a41f7e7 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 ccbc878..a68e50f 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 7de640f..7f47f6d 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 754157a..33bdb38 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/DOTween50.xml b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween50.xml index 7952aa7..dda8e6b 100644 --- a/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween50.xml +++ b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween50.xml @@ -108,5 +108,18 @@ and returns the total number of tweens involved. + + + Methods that extend Tween objects and allow to control or get data from them. + These require at least Unity 5.3 + + + + + Returns a that waits until the tween is killed or complete. + It can be used inside a coroutine as a yield. + Example usage:yield return myTween.WaitForCompletionCY(); + + diff --git a/UnityTests.Unity4/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll b/UnityTests.Unity4/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll index 88419a0..1b20b39 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 916e1c1..5138403 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.dll b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll index 14f1da2..39fe03e 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 8a19802..3c3f66a 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 82779f1..17b117d 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 b5fb952..88d81a2 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 5c28caa..a41f7e7 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 ccbc878..a68e50f 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 7de640f..7f47f6d 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 754157a..33bdb38 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/DOTween50.xml b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween50.xml index 7952aa7..dda8e6b 100644 --- a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween50.xml +++ b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween50.xml @@ -108,5 +108,18 @@ and returns the total number of tweens involved. + + + Methods that extend Tween objects and allow to control or get data from them. + These require at least Unity 5.3 + + + + + Returns a that waits until the tween is killed or complete. + It can be used inside a coroutine as a yield. + Example usage:yield return myTween.WaitForCompletionCY(); + + diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll b/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll index 88419a0..1b20b39 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 916e1c1..5138403 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/CustomYieldInstructions.cs b/UnityTests.Unity5/Assets/_Tests/CustomYieldInstructions.cs new file mode 100644 index 0000000..92e5ebc --- /dev/null +++ b/UnityTests.Unity5/Assets/_Tests/CustomYieldInstructions.cs @@ -0,0 +1,19 @@ +using System.Collections; +using System.Collections.Generic; +using DG.Tweening; +using DG.Tweening.CustomYieldInstructions; +using UnityEngine; + +public class CustomYieldInstructions : BrainBase +{ + public Transform target; + + IEnumerator Start() + { + yield return new WaitForSeconds(1); + + Debug.Log("01"); + yield return target.DOMoveX(2, 1).WaitForCompletionCY(); + Debug.Log("02"); + } +} \ No newline at end of file diff --git a/UnityTests.Unity5/Assets/_Tests/CustomYieldInstructions.cs.meta b/UnityTests.Unity5/Assets/_Tests/CustomYieldInstructions.cs.meta new file mode 100644 index 0000000..6f7e154 --- /dev/null +++ b/UnityTests.Unity5/Assets/_Tests/CustomYieldInstructions.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 0e2609f52a4e23643be3f692520e0148 +timeCreated: 1527844217 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityTests.Unity5/Assets/_Tests/CustomYieldInstructions.unity b/UnityTests.Unity5/Assets/_Tests/CustomYieldInstructions.unity new file mode 100644 index 0000000..e22c48e Binary files /dev/null and b/UnityTests.Unity5/Assets/_Tests/CustomYieldInstructions.unity differ diff --git a/UnityTests.Unity5/Assets/_Tests/CustomYieldInstructions.unity.meta b/UnityTests.Unity5/Assets/_Tests/CustomYieldInstructions.unity.meta new file mode 100644 index 0000000..5119942 --- /dev/null +++ b/UnityTests.Unity5/Assets/_Tests/CustomYieldInstructions.unity.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 06794199ff7400946acd72ccd1ad4fbb +DefaultImporter: + userData: diff --git a/UnityTests.Unity5/Assets/_Tests/TempTests.cs b/UnityTests.Unity5/Assets/_Tests/TempTests.cs index c6f7e90..569ed6f 100644 --- a/UnityTests.Unity5/Assets/_Tests/TempTests.cs +++ b/UnityTests.Unity5/Assets/_Tests/TempTests.cs @@ -11,120 +11,18 @@ using UnityEngine.UI; public class TempTests : BrainBase { - public float TimeScale = 1; - public int ConcurrentRunningSequences = 10000; - public int loops = 1; - public LoopType loopType = LoopType.Restart; + public Transform target; - int _createdSequenceCount; - int _completedSequenceCount; - - int _callbackZeroCount; - int _callbackOneCount; - int _callbackTwoCount; - int _callbackThreeCount; - - bool _isTestingInProgress = false; - float _time; - - void Start() + IEnumerator Start() { - DOTween.Init(); - DOTween.SetTweensCapacity(200, 30000); - } + yield return new WaitForSeconds(1); - void Update() - { - Time.timeScale = TimeScale; - } - - void OnGUI() - { - GUILayout.Label((Time.realtimeSinceStartup - _time).ToString("n3")); - GUILayout.Space(4); - - if (!_isTestingInProgress) - { - if (GUILayout.Button("Start Testing")) - { - _isTestingInProgress = true; - _time = Time.realtimeSinceStartup; - - for (int i = 0; i < ConcurrentRunningSequences; i++) - { - StartSequence(); - } - } - } - else - { - if (GUILayout.Button("Stop Testing")) - { - _isTestingInProgress = false; - } - } - - GUILayout.Label(string.Format("Created Sequences: {0}", _createdSequenceCount.ToString("n0"))); - GUILayout.Label(string.Format("Completed Sequences: {0}", _completedSequenceCount.ToString("n0"))); - - GUILayout.Space(20); - - GUILayout.Label(string.Format("Callback 0 Count: {0}", _callbackZeroCount.ToString("n0"))); - GUILayout.Label(string.Format("Callback 1 Count: {0}", _callbackOneCount.ToString("n0"))); - GUILayout.Label(string.Format("Callback 2 Count: {0}", _callbackTwoCount.ToString("n0"))); - GUILayout.Label(string.Format("Callback 3 Count: {0}", _callbackThreeCount.ToString("n0"))); - } - - void StartSequence() - { - _createdSequenceCount++; - int added0 = 0; - int added1 = 0; - int added2 = 0; - int added3 = 0; - int check = loops - 1; - - DOTween.Sequence() - .SetLoops(loops, LoopType.Restart) - .AppendCallback(() => - { - if (added0 > check) LogError(0); - _callbackZeroCount++; - added0++; - }) -// .AppendInterval(0.25f) // THIS WORKS - .AppendInterval(UnityEngine.Random.Range(0.25f, 1.5f)) - .AppendCallback(() => - { - if (added1 > check) LogError(1); - _callbackOneCount++; - added1++; - }) - .AppendInterval(0.5f) - .AppendCallback(() => - { - if (added2 > check) LogError(2); - _callbackTwoCount++; - added2++; - }) - .AppendInterval(0.25f) - .AppendCallback(() => - { - if (added3 > check) LogError(3); - _callbackThreeCount++; - added3++; - }) - .OnComplete(()=> { - _completedSequenceCount++; - if (_isTestingInProgress) StartSequence(); - }); - } - - void LogError(int index) - { - Debug.LogError(index + " already added"); -// Debug.Log("currUseInvers-currPrevPosIsInverse: " + Sequence.currUseInverse + " - " + Sequence.currPrevPosIsInverse); -// Debug.Log("currFrom-to: " + Sequence.currFrom.ToString("n10") + " - " + Sequence.currTo.ToString("n10")); -// Debug.Log("currCallbackStart-End time: " + Sequence.currCallbackTime.ToString("n10") + " - " + Sequence.currCallbackEndTime.ToString("n10")); + Sequence s = DOTween.Sequence() + .OnStart(() => Debug.Log("START")) + .Append(target.DOMoveX(2, 1).OnStart(() => Debug.Log("Append X"))) + .SetDelay(1) + .Join(target.DOMoveY(2, 1).OnStart(() => Debug.Log("Join y"))) + .SetDelay(2) + .OnComplete(()=> Debug.Log("COMPLETE")); } } \ No newline at end of file diff --git a/UnityTests.Unity5/Assets/_Tests/TempTests.unity b/UnityTests.Unity5/Assets/_Tests/TempTests.unity index 8455497..5a0dc7b 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.sln.DotSettings b/_DOTween.Assembly/DOTween.sln.DotSettings new file mode 100644 index 0000000..0f129db --- /dev/null +++ b/_DOTween.Assembly/DOTween.sln.DotSettings @@ -0,0 +1,2 @@ + + CY \ No newline at end of file diff --git a/_DOTween.Assembly/DOTween/DOTween.cs b/_DOTween.Assembly/DOTween/DOTween.cs index 90b45f0..b81fbcd 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.735"; + public static readonly string Version = "1.1.745"; /////////////////////////////////////////////// // Options //////////////////////////////////// diff --git a/_DOTween.Assembly/DOTween/Properties/AssemblyInfo.cs b/_DOTween.Assembly/DOTween/Properties/AssemblyInfo.cs index f14e9e4..6855938 100644 --- a/_DOTween.Assembly/DOTween/Properties/AssemblyInfo.cs +++ b/_DOTween.Assembly/DOTween/Properties/AssemblyInfo.cs @@ -6,6 +6,7 @@ using System.Runtime.InteropServices; [assembly: InternalsVisibleTo("DOTweenEditor")] [assembly: InternalsVisibleTo("DOTween43")] [assembly: InternalsVisibleTo("DOTween46")] +[assembly: InternalsVisibleTo("DOTween50")] [assembly: InternalsVisibleTo("DOTweenPro")] [assembly: InternalsVisibleTo("DOTweenProEditor")] diff --git a/_DOTween.Assembly/DOTween/ShortcutExtensions.cs b/_DOTween.Assembly/DOTween/ShortcutExtensions.cs index 4456d9b..baf02c7 100644 --- a/_DOTween.Assembly/DOTween/ShortcutExtensions.cs +++ b/_DOTween.Assembly/DOTween/ShortcutExtensions.cs @@ -461,19 +461,21 @@ namespace DG.Tweening public static Sequence DOJump(this Rigidbody target, Vector3 endValue, float jumpPower, int numJumps, float duration, bool snapping = false) { if (numJumps < 1) numJumps = 1; - float startPosY = target.position.y; + float startPosY = 0; float offsetY = -1; bool offsetYSet = false; Sequence s = DOTween.Sequence(); #if COMPATIBLE Tween yTween = DOTween.To(() => target.position, x => target.MovePosition(x.value), new Vector3(0, jumpPower, 0), duration / (numJumps * 2)) .SetOptions(AxisConstraint.Y, snapping).SetEase(Ease.OutQuad).SetRelative() - .SetLoops(numJumps * 2, LoopType.Yoyo); + .SetLoops(numJumps * 2, LoopType.Yoyo) + .OnStart(()=> startPosY = target.position.y); s.Append(DOTween.To(() => target.position, x => target.MovePosition(x.value), new Vector3(endValue.x, 0, 0), duration) #else Tween yTween = DOTween.To(() => target.position, target.MovePosition, new Vector3(0, jumpPower, 0), duration / (numJumps * 2)) .SetOptions(AxisConstraint.Y, snapping).SetEase(Ease.OutQuad).SetRelative() - .SetLoops(numJumps * 2, LoopType.Yoyo); + .SetLoops(numJumps * 2, LoopType.Yoyo) + .OnStart(() => startPosY = target.position.y); s.Append(DOTween.To(() => target.position, target.MovePosition, new Vector3(endValue.x, 0, 0), duration) #endif .SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear) @@ -972,7 +974,7 @@ namespace DG.Tweening public static Sequence DOJump(this Transform target, Vector3 endValue, float jumpPower, int numJumps, float duration, bool snapping = false) { if (numJumps < 1) numJumps = 1; - float startPosY = target.position.y; + float startPosY = 0; float offsetY = -1; bool offsetYSet = false; @@ -981,7 +983,8 @@ namespace DG.Tweening Sequence s = DOTween.Sequence(); Tween yTween = DOTween.To(() => target.position, x => target.position = x, new Vector3(0, jumpPower, 0), duration / (numJumps * 2)) .SetOptions(AxisConstraint.Y, snapping).SetEase(Ease.OutQuad).SetRelative() - .SetLoops(numJumps * 2, LoopType.Yoyo); + .SetLoops(numJumps * 2, LoopType.Yoyo) + .OnStart(()=> startPosY = target.position.y); s.Append(DOTween.To(() => target.position, x => target.position = x, new Vector3(endValue.x, 0, 0), duration) .SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear) ).Join(DOTween.To(() => target.position, x => target.position = x, new Vector3(0, 0, endValue.z), duration) diff --git a/_DOTween.Assembly/DOTween43/ShortcutExtensions43.cs b/_DOTween.Assembly/DOTween43/ShortcutExtensions43.cs index ec17317..8fc3609 100644 --- a/_DOTween.Assembly/DOTween43/ShortcutExtensions43.cs +++ b/_DOTween.Assembly/DOTween43/ShortcutExtensions43.cs @@ -178,33 +178,35 @@ namespace DG.Tweening public static Sequence DOJump(this Rigidbody2D target, Vector2 endValue, float jumpPower, int numJumps, float duration, bool snapping = false) { if (numJumps < 1) numJumps = 1; - float startPosY = target.position.y; + float startPosY = 0; float offsetY = -1; bool offsetYSet = false; Sequence s = DOTween.Sequence(); #if COMPATIBLE - s.Append(DOTween.To(() => target.position, x => target.position = x.value, new Vector3(endValue.x, 0, 0), duration) + Tween yTween = DOTween.To(() => target.position, x => target.position = x.value, new Vector2(0, jumpPower), duration / (numJumps * 2)) + .SetOptions(AxisConstraint.Y, snapping).SetEase(Ease.OutQuad).SetRelative() + .SetLoops(numJumps * 2, LoopType.Yoyo) + .OnStart(() => startPosY = target.position.y); + s.Append(DOTween.To(() => target.position, x => target.position = x.value, new Vector2(endValue.x, 0), duration) #else + Tween yTween = DOTween.To(() => target.position, x => target.position = x, new Vector2(0, jumpPower), duration / (numJumps * 2)) + .SetOptions(AxisConstraint.Y, snapping).SetEase(Ease.OutQuad).SetRelative() + .SetLoops(numJumps * 2, LoopType.Yoyo) + .OnStart(() => startPosY = target.position.y); s.Append(DOTween.To(() => target.position, x => target.position = x, new Vector2(endValue.x, 0), duration) #endif .SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear) - .OnUpdate(() => { - if (!offsetYSet) { - offsetYSet = true; - offsetY = s.isRelative ? endValue.y : endValue.y - startPosY; - } - Vector2 pos = target.position; - pos.y += DOVirtual.EasedValue(0, offsetY, s.ElapsedDirectionalPercentage(), Ease.OutQuad); - target.position = pos; - }) -#if COMPATIBLE - ).Join(DOTween.To(() => target.position, x => target.position = x.value, new Vector3(0, jumpPower, 0), duration / (numJumps * 2)) -#else - ).Join(DOTween.To(() => target.position, x=> target.position = x, new Vector2(0, jumpPower), duration / (numJumps * 2)) -#endif - .SetOptions(AxisConstraint.Y, snapping).SetEase(Ease.OutQuad) - .SetLoops(numJumps * 2, LoopType.Yoyo).SetRelative() - ).SetTarget(target).SetEase(DOTween.defaultEaseType); + ).Join(yTween) + .SetTarget(target).SetEase(DOTween.defaultEaseType); + yTween.OnUpdate(() => { + if (!offsetYSet) { + offsetYSet = true; + offsetY = s.isRelative ? endValue.y : endValue.y - startPosY; + } + Vector3 pos = target.position; + pos.y += DOVirtual.EasedValue(0, offsetY, yTween.ElapsedPercentage(), Ease.OutQuad); + target.MovePosition(pos); + }); return s; } diff --git a/_DOTween.Assembly/DOTween50/CustomYieldInstructions/WaitForCompletion.cs b/_DOTween.Assembly/DOTween50/CustomYieldInstructions/WaitForCompletion.cs new file mode 100644 index 0000000..7636788 --- /dev/null +++ b/_DOTween.Assembly/DOTween50/CustomYieldInstructions/WaitForCompletion.cs @@ -0,0 +1,26 @@ +// Author: Daniele Giardini - http://www.demigiant.com +// Created: 2018/06/01 10:55 +// License Copyright (c) Daniele Giardini +// This work is subject to the terms at http://dotween.demigiant.com/license.php + +using UnityEngine; + +#pragma warning disable 1591 +namespace DG.Tweening.CustomYieldInstructions +{ + public class WaitForCompletion : CustomYieldInstruction + { + public override bool keepWaiting { + get { + return _tween.active && !_tween.isComplete; + } + } + + readonly Tween _tween; + + public WaitForCompletion(Tween tween) + { + _tween = tween; + } + } +} \ No newline at end of file diff --git a/_DOTween.Assembly/DOTween50/DOTween50.csproj b/_DOTween.Assembly/DOTween50/DOTween50.csproj index 9006927..bb7db41 100644 --- a/_DOTween.Assembly/DOTween50/DOTween50.csproj +++ b/_DOTween.Assembly/DOTween50/DOTween50.csproj @@ -67,8 +67,10 @@ + + @@ -77,6 +79,7 @@ False + set BinDir=bin.Global\DOTween diff --git a/_DOTween.Assembly/DOTween50/TweenExtensions53.cs b/_DOTween.Assembly/DOTween50/TweenExtensions53.cs new file mode 100644 index 0000000..a35eae9 --- /dev/null +++ b/_DOTween.Assembly/DOTween50/TweenExtensions53.cs @@ -0,0 +1,37 @@ +// Author: Daniele Giardini - http://www.demigiant.com +// Created: 2018/06/01 10:49 +// License Copyright (c) Daniele Giardini +// This work is subject to the terms at http://dotween.demigiant.com/license.php + +using DG.Tweening.Core; +using DG.Tweening.CustomYieldInstructions; +using UnityEngine; + +namespace DG.Tweening +{ + /// + /// Methods that extend Tween objects and allow to control or get data from them. + /// These require at least Unity 5.3 + /// + public static class TweenExtensions53 + { + #region Custom Yield Instructions + + /// + /// Returns a that waits until the tween is killed or complete. + /// It can be used inside a coroutine as a yield. + /// Example usage:yield return myTween.WaitForCompletionCY(); + /// + public static CustomYieldInstruction WaitForCompletionCY(this Tween t) + { + if (!t.active) { + if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t); + return null; + } + + return new WaitForCompletion(t); + } + + #endregion + } +} \ No newline at end of file diff --git a/_DOTween.Assembly/bin/DOTween.dll b/_DOTween.Assembly/bin/DOTween.dll index 14f1da2..39fe03e 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 8a19802..3c3f66a 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 82779f1..17b117d 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 b5fb952..88d81a2 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 5c28caa..a41f7e7 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 ccbc878..a68e50f 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 7de640f..7f47f6d 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 754157a..33bdb38 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/DOTween50.xml b/_DOTween.Assembly/bin/DOTween50.xml index 7952aa7..dda8e6b 100644 --- a/_DOTween.Assembly/bin/DOTween50.xml +++ b/_DOTween.Assembly/bin/DOTween50.xml @@ -108,5 +108,18 @@ and returns the total number of tweens involved. + + + Methods that extend Tween objects and allow to control or get data from them. + These require at least Unity 5.3 + + + + + Returns a that waits until the tween is killed or complete. + It can be used inside a coroutine as a yield. + Example usage:yield return myTween.WaitForCompletionCY(); + + diff --git a/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll b/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll index 88419a0..1b20b39 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 916e1c1..5138403 100644 Binary files a/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll.mdb and b/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll.mdb differ