diff --git a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.dll b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.dll index ab82c3b..e8f9af8 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 0499443..c5a6275 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 ab82c3b..e8f9af8 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 0499443..c5a6275 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 ab82c3b..e8f9af8 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 0499443..c5a6275 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/_DOTween Examples/DOJumpLookAtPath.cs b/UnityTests.Unity5/Assets/_DOTween Examples/DOJumpLookAtPath.cs new file mode 100644 index 0000000..f70b0e6 --- /dev/null +++ b/UnityTests.Unity5/Assets/_DOTween Examples/DOJumpLookAtPath.cs @@ -0,0 +1,24 @@ +using System.Collections; +using System.Collections.Generic; +using DG.Tweening; +using UnityEngine; + +public class DOJumpLookAtPath : MonoBehaviour +{ + public Transform target; + public float duration; + public float jumpPower; + public Vector3 jumpEnd; + + IEnumerator Start() + { + yield return new WaitForSeconds(0.8f); + + float midP = duration * 0.25f; // approximate mid point when using an OutQuad ease + Vector3 jumpPeak = jumpEnd - target.position + new Vector3(0, jumpPower, 0); + Sequence s = DOTween.Sequence() + .Join(target.DOJump(jumpEnd, jumpPower, 1, duration)) + .Join(target.DOLookAt(jumpPeak, midP * 0.05f)) // Make this faster so it looks almost immediately + .Insert(midP, target.DOLookAt(jumpEnd, duration - midP, AxisConstraint.Z)); + } +} \ No newline at end of file diff --git a/UnityTests.Unity5/Assets/_DOTween Examples/DOJumpLookAtPath.cs.meta b/UnityTests.Unity5/Assets/_DOTween Examples/DOJumpLookAtPath.cs.meta new file mode 100644 index 0000000..94d979e --- /dev/null +++ b/UnityTests.Unity5/Assets/_DOTween Examples/DOJumpLookAtPath.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: acf2ce93692191740920bab74b5b7d9e +timeCreated: 1506945621 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityTests.Unity5/Assets/_DOTween Examples/DOJumpLookAtPath.unity b/UnityTests.Unity5/Assets/_DOTween Examples/DOJumpLookAtPath.unity new file mode 100644 index 0000000..54a1deb Binary files /dev/null and b/UnityTests.Unity5/Assets/_DOTween Examples/DOJumpLookAtPath.unity differ diff --git a/UnityTests.Unity5/Assets/_DOTween Examples/DOJumpLookAtPath.unity.meta b/UnityTests.Unity5/Assets/_DOTween Examples/DOJumpLookAtPath.unity.meta new file mode 100644 index 0000000..90d4c9a --- /dev/null +++ b/UnityTests.Unity5/Assets/_DOTween Examples/DOJumpLookAtPath.unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 74761f122846fbc4a834d4d3660a6668 +timeCreated: 1506945613 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityTests.Unity5/Assets/_Tests PRO/TempPro.cs b/UnityTests.Unity5/Assets/_Tests PRO/TempPro.cs index 48e574d..4f09355 100644 --- a/UnityTests.Unity5/Assets/_Tests PRO/TempPro.cs +++ b/UnityTests.Unity5/Assets/_Tests PRO/TempPro.cs @@ -7,37 +7,17 @@ using UnityEngine.SceneManagement; public class TempPro : MonoBehaviour { public Transform target; - public Vector3 damageShakeStrength = new Vector3( 0.4f, 0.2f, 0 ); - public int damageShakeVibration = 7; - public float damageShakeRandomness = 15; - public float damageShakeDuration = 1.5f; - private Tweener screenShake; - private Vector3 original; - - // Use this for initialization void Start() { - original = target.position; +// target.DOScale(2, 0.1f).SetLoops(2, LoopType.Yoyo).SetAutoKill(false).Pause(); } - // Update is called once per frame void Update() { - if ( Input.GetKeyDown( KeyCode.K ) ) - Time.timeScale = Time.timeScale < 1 ? Time.timeScale = 1 : 0; - - if ( Input.GetKeyDown( KeyCode.S ) ) - { - Vector3 shakeOffset = new Vector3(); - screenShake = DOTween.Shake( () => shakeOffset, x => { shakeOffset = x; target.position += x; }, damageShakeDuration, damageShakeStrength, damageShakeVibration, damageShakeRandomness, false ) - .SetUpdate( false ); -// screenShake = target.DOMoveX(10, damageShakeDuration); -// screenShake = target.DOShakePosition(damageShakeDuration, damageShakeStrength, damageShakeVibration, damageShakeRandomness, false); - screenShake.OnComplete( () => - { - screenShake = target.DOMove( original, 0.5f ).OnComplete( () => screenShake = null ).SetUpdate( false ); - } ); - } + if (Input.GetKeyDown(KeyCode.Space)) { + Debug.Log(DOTween.TweensByTarget(target).Count); + target.DOPlay(); + } else if (Input.GetKeyDown(KeyCode.E)) target.GetComponent().DOPlay(); } } \ 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 2ad7cdb..753b2e6 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/Bugs/IndexOutOfRangeOnKill.cs b/UnityTests.Unity5/Assets/_Tests/Bugs/IndexOutOfRangeOnKill.cs index a2623e7..d4fdce6 100644 --- a/UnityTests.Unity5/Assets/_Tests/Bugs/IndexOutOfRangeOnKill.cs +++ b/UnityTests.Unity5/Assets/_Tests/Bugs/IndexOutOfRangeOnKill.cs @@ -10,13 +10,13 @@ public class IndexOutOfRangeOnKill : BrainBase transform.DOScale(Vector3.zero, 1000).OnKill(() => transform.gameObject.SetActive(false)); yield return new WaitForSeconds(1.5f); transform.DOKill(); - Debug.Log("START COMPLETION"); + Debug.Log("Start() completed"); } void OnDisable() { - Debug.Log("DISABLE"); + Debug.Log("OnDisable()"); transform.DOKill(); } } \ No newline at end of file diff --git a/UnityTests.Unity5/Assets/_Tests/Bugs/IndexOutOfRangeOnKill02.cs b/UnityTests.Unity5/Assets/_Tests/Bugs/IndexOutOfRangeOnKill02.cs new file mode 100644 index 0000000..14d6a29 --- /dev/null +++ b/UnityTests.Unity5/Assets/_Tests/Bugs/IndexOutOfRangeOnKill02.cs @@ -0,0 +1,34 @@ +using System.Collections; +using System.Collections.Generic; +using DG.Tweening; +using UnityEngine; + +public class IndexOutOfRangeOnKill02 : MonoBehaviour +{ + // Can't replicate the error + void Start() + { + Debug.Log("Start() ► Disabling safe mode"); + + DOTween.Init(false, false); + + Tween t = transform.DOMoveX(2, 2); + t.OnComplete(() => { + Debug.Log("OnComplete()"); + TweenKiller(); + Destroy(gameObject); + }); + } + + void OnDestroy() + { + Debug.Log("OnDestroy()"); + TweenKiller(); + } + + void TweenKiller() + { + Debug.Log("TweenKiller()"); + transform.DOKill(true); + } +} \ No newline at end of file diff --git a/UnityTests.Unity5/Assets/_Tests/Bugs/IndexOutOfRangeOnKill02.cs.meta b/UnityTests.Unity5/Assets/_Tests/Bugs/IndexOutOfRangeOnKill02.cs.meta new file mode 100644 index 0000000..6010654 --- /dev/null +++ b/UnityTests.Unity5/Assets/_Tests/Bugs/IndexOutOfRangeOnKill02.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 1640399a20baa4b49a8159d55b1b5633 +timeCreated: 1507028404 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityTests.Unity5/Assets/_Tests/Bugs/IndexOutOfRangeOnKill02.unity b/UnityTests.Unity5/Assets/_Tests/Bugs/IndexOutOfRangeOnKill02.unity new file mode 100644 index 0000000..973ebe9 Binary files /dev/null and b/UnityTests.Unity5/Assets/_Tests/Bugs/IndexOutOfRangeOnKill02.unity differ diff --git a/UnityTests.Unity5/Assets/_Tests/Bugs/IndexOutOfRangeOnKill02.unity.meta b/UnityTests.Unity5/Assets/_Tests/Bugs/IndexOutOfRangeOnKill02.unity.meta new file mode 100644 index 0000000..d71ba96 --- /dev/null +++ b/UnityTests.Unity5/Assets/_Tests/Bugs/IndexOutOfRangeOnKill02.unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f6e7f8051bf9e5e419cb197ecdb0105b +timeCreated: 1507028396 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityTests.Unity5/Assets/_Tests/TempTests.cs b/UnityTests.Unity5/Assets/_Tests/TempTests.cs index e3b82a1..039ebc3 100644 --- a/UnityTests.Unity5/Assets/_Tests/TempTests.cs +++ b/UnityTests.Unity5/Assets/_Tests/TempTests.cs @@ -12,16 +12,11 @@ using UnityEngine.UI; public class TempTests : BrainBase { public Rigidbody target; + public float duration = 1f; void Start() { - target.DOMoveY(10, 0.3f).OnComplete(()=> { - Debug.Log("complete"); - }); - } - - void Update() - { - if (Input.GetKeyDown(KeyCode.Space)) SceneManager.LoadScene(SceneManager.GetActiveScene().name); + target.transform.DOJump(new Vector3(2.5f, 1.5f, -4.5f), 2, 1, duration).SetDelay(1) + .OnComplete(()=> Debug.Log(target.position)); } } \ No newline at end of file diff --git a/UnityTests.Unity5/Assets/_Tests/TempTests.unity b/UnityTests.Unity5/Assets/_Tests/TempTests.unity index 4ed4fbe..74f97a0 100644 Binary files a/UnityTests.Unity5/Assets/_Tests/TempTests.unity and b/UnityTests.Unity5/Assets/_Tests/TempTests.unity differ diff --git a/UnityTests.Unity5/ProjectSettings/ProjectVersion.txt b/UnityTests.Unity5/ProjectSettings/ProjectVersion.txt index 54fa55b..cec5751 100644 --- a/UnityTests.Unity5/ProjectSettings/ProjectVersion.txt +++ b/UnityTests.Unity5/ProjectSettings/ProjectVersion.txt @@ -1 +1 @@ -m_EditorVersion: 5.6.3p1 +m_EditorVersion: 5.6.3p4 diff --git a/_DOTween.Assembly/DOTween/DOTween.cs b/_DOTween.Assembly/DOTween/DOTween.cs index b5cd86c..c61e599 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.650"; + public static readonly string Version = "1.1.655"; /////////////////////////////////////////////// // Options //////////////////////////////////// diff --git a/_DOTween.Assembly/DOTween/ShortcutExtensions.cs b/_DOTween.Assembly/DOTween/ShortcutExtensions.cs index 727e5d5..6d4275a 100644 --- a/_DOTween.Assembly/DOTween/ShortcutExtensions.cs +++ b/_DOTween.Assembly/DOTween/ShortcutExtensions.cs @@ -1283,6 +1283,38 @@ namespace DG.Tweening return t; } + // Added by Steve Streeting > https://github.com/sinbad + /// Punches a Transform's localRotation BY the given value and then back to the starting one + /// as if it was connected to the starting rotation via an elastic. Does it in a way that allows other + /// DOBlendableRotate tweens to work together on the same target + /// The punch strength (added to the Transform's current rotation) + /// The duration of the tween + /// Indicates how much will the punch vibrate + /// Represents how much (0 to 1) the vector will go beyond the starting rotation when bouncing backwards. + /// 1 creates a full oscillation between the punch rotation and the opposite rotation, + /// while 0 oscillates only between the punch and the start rotation + public static Tweener DOBlendablePunchRotation(this Transform target, Vector3 punch, float duration, int vibrato = 10, float elasticity = 1) + { + if (duration <= 0) { + if (Debugger.logPriority > 0) Debug.LogWarning("DOBlendablePunchRotation: duration can't be 0, returning NULL without creating a tween"); + return null; + } + Vector3 to = Vector3.zero; + TweenerCore t = DOTween.Punch(() => to, v => { + Quaternion qto = Quaternion.Euler(to.x, to.y, to.z); + Quaternion qnew = Quaternion.Euler(v.x, v.y, v.z); +#if COMPATIBLE + Quaternion diff = x.value * Quaternion.Inverse(qto); +#else + Quaternion diff = qnew * Quaternion.Inverse(qto); +#endif + to = v; + target.rotation = target.rotation * Quaternion.Inverse(target.rotation) * diff * target.rotation; + }, punch, duration, vibrato, elasticity) + .Blendable().SetTarget(target); + return t; + } + /// Tweens a Transform's localScale BY the given value (as if you chained a SetRelative), /// in a way that allows other DOBlendableScale tweens to work together on the same target, /// instead than fight each other as multiple DOScale would do. diff --git a/_DOTween.Assembly/bin/DOTween.dll b/_DOTween.Assembly/bin/DOTween.dll index ab82c3b..e8f9af8 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 0499443..c5a6275 100644 Binary files a/_DOTween.Assembly/bin/DOTween.dll.mdb and b/_DOTween.Assembly/bin/DOTween.dll.mdb differ