diff --git a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.dll b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.dll index 905b1ff..4210724 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 92a87fc..73b8127 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 b1e69ab..1aed027 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 d379f64..809713b 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 fd21943..ea0b871 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 41d8231..0689185 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 99b2a11..afd0c94 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 48ed5e3..4438b97 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 148ec92..7820f3b 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 b811b10..fb8c228 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 905b1ff..4210724 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 92a87fc..73b8127 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 b1e69ab..1aed027 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 d379f64..809713b 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 fd21943..ea0b871 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 41d8231..0689185 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 99b2a11..afd0c94 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 48ed5e3..4438b97 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 148ec92..7820f3b 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 b811b10..fb8c228 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 905b1ff..4210724 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 92a87fc..73b8127 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 b1e69ab..1aed027 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 d379f64..809713b 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 fd21943..ea0b871 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 41d8231..0689185 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 99b2a11..afd0c94 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 48ed5e3..4438b97 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 148ec92..7820f3b 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 b811b10..fb8c228 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/AnimationEditor.unity b/UnityTests.Unity5/Assets/_Tests PRO/AnimationEditor.unity index 6f1c455..47418cb 100644 Binary files a/UnityTests.Unity5/Assets/_Tests PRO/AnimationEditor.unity and b/UnityTests.Unity5/Assets/_Tests PRO/AnimationEditor.unity differ diff --git a/UnityTests.Unity5/Assets/_Tests PRO/TempPro.unity b/UnityTests.Unity5/Assets/_Tests PRO/TempPro.unity index 61ba61f..896fea8 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 PRO/TempPro_B.unity b/UnityTests.Unity5/Assets/_Tests PRO/TempPro_B.unity index fd6f313..6c46eac 100644 Binary files a/UnityTests.Unity5/Assets/_Tests PRO/TempPro_B.unity and b/UnityTests.Unity5/Assets/_Tests PRO/TempPro_B.unity differ diff --git a/UnityTests.Unity5/Assets/_Tests/TempTests.cs b/UnityTests.Unity5/Assets/_Tests/TempTests.cs index 7682932..fe057a5 100644 --- a/UnityTests.Unity5/Assets/_Tests/TempTests.cs +++ b/UnityTests.Unity5/Assets/_Tests/TempTests.cs @@ -9,15 +9,20 @@ using UnityEngine.UI; public class TempTests : BrainBase { - public Transform trans; - public Renderer rend; + public Transform target; + public float delay = 0; - IEnumerator Start() + void Start() { - yield return new WaitForSeconds(1); + Tween t = target.DOJump(new Vector3(4, 3, 0), 2, 1, 1).SetRelative(); + if (delay > 0) t.SetDelay(delay); + t.OnStart(()=>Debug.Log("Start")); + t.OnComplete(()=>Debug.Log("Complete")); - DOTween.Sequence() - .Append(rend.material.DOFade(0, 0.5f)) - .Append(rend.material.DOFade(1, 1f)); + + // Tween t = DOTween.Sequence().Append(target.DOMoveX(2, 1).SetRelative()); + // if (delay > 0) t.SetDelay(delay); + // t.OnStart(()=>Debug.Log("Start")); + // t.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 5d29633..21b5ff3 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/Sequence.cs b/_DOTween.Assembly/DOTween/Sequence.cs index e5c6b56..6561cfd 100644 --- a/_DOTween.Assembly/DOTween/Sequence.cs +++ b/_DOTween.Assembly/DOTween/Sequence.cs @@ -39,7 +39,8 @@ namespace DG.Tweening internal static Sequence DoPrepend(Sequence inSequence, Tween t) { if (t.loops == -1) t.loops = 1; - float tFullTime = t.delay + (t.duration * t.loops); +// float tFullTime = t.delay + (t.duration * t.loops); + float tFullTime = t.duration * t.loops; inSequence.duration += tFullTime; int len = inSequence._sequencedObjs.Count; for (int i = 0; i < len; ++i) { @@ -55,17 +56,17 @@ namespace DG.Tweening { TweenManager.AddActiveTweenToSequence(t); - // If t has a delay add it as an interval - atPosition += t.delay; - inSequence.lastTweenInsertTime = atPosition; +// // If t has a delay add it as an interval +// atPosition += t.delay; +// inSequence.lastTweenInsertTime = atPosition; t.isSequenced = t.creationLocked = true; t.sequenceParent = inSequence; if (t.loops == -1) t.loops = 1; float tFullTime = t.duration * t.loops; t.autoKill = false; - t.delay = t.elapsedDelay = 0; - t.delayComplete = true; +// t.delay = t.elapsedDelay = 0; +// t.delayComplete = true; t.isSpeedBased = false; t.sequencedPosition = atPosition; t.sequencedEndPosition = atPosition + tFullTime; diff --git a/_DOTween.Assembly/DOTween/ShortcutExtensions.cs b/_DOTween.Assembly/DOTween/ShortcutExtensions.cs index 77da952..cafdfe3 100644 --- a/_DOTween.Assembly/DOTween/ShortcutExtensions.cs +++ b/_DOTween.Assembly/DOTween/ShortcutExtensions.cs @@ -442,13 +442,22 @@ namespace DG.Tweening float startPosY = target.position.y; float offsetY = -1; bool offsetYSet = false; - Sequence s = DOTween.Sequence() + Sequence s = DOTween.Sequence(); #if COMPATIBLE - .Append(DOTween.To(() => target.position, x => target.MovePosition(x.value), new Vector3(endValue.x, 0, 0), duration) + s.Append(DOTween.To(() => target.position, x => target.MovePosition(x.value), new Vector3(endValue.x, 0, 0), duration) #else - .Append(DOTween.To(() => target.position, target.MovePosition, new Vector3(endValue.x, 0, 0), duration) + s.Append(DOTween.To(() => target.position, target.MovePosition, new Vector3(endValue.x, 0, 0), duration) #endif .SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear) + .OnUpdate(() => { + if (!offsetYSet) { + offsetYSet = false; + offsetY = s.isRelative ? endValue.y : endValue.y - startPosY; + } + Vector3 pos = target.position; + pos.y += DOVirtual.EasedValue(0, offsetY, s.ElapsedDirectionalPercentage(), Ease.OutQuad); + target.MovePosition(pos); + }) #if COMPATIBLE ).Join(DOTween.To(() => target.position, x => target.MovePosition(x.value), new Vector3(0, 0, endValue.z), duration) #else @@ -463,15 +472,6 @@ namespace DG.Tweening .SetOptions(AxisConstraint.Y, snapping).SetEase(Ease.OutQuad) .SetLoops(numJumps * 2, LoopType.Yoyo).SetRelative() ).SetTarget(target).SetEase(DOTween.defaultEaseType); - s.OnUpdate(() => { - if (!offsetYSet) { - offsetYSet = false; - offsetY = s.isRelative ? endValue.y : endValue.y - startPosY; - } - Vector3 pos = target.position; - pos.y += DOVirtual.EasedValue(0, offsetY, s.ElapsedDirectionalPercentage(), Ease.OutQuad); - target.MovePosition(pos); - }); return s; } @@ -803,24 +803,26 @@ namespace DG.Tweening float startPosY = target.position.y; float offsetY = -1; bool offsetYSet = false; - Sequence s = DOTween.Sequence() - .Append(DOTween.To(() => target.position, x => target.position = x, new Vector3(endValue.x, 0, 0), duration) + + + Sequence s = DOTween.Sequence(); + s.Append(DOTween.To(() => target.position, x => target.position = x, new Vector3(endValue.x, 0, 0), duration) .SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear) + .OnUpdate(() => { + if (!offsetYSet) { + offsetYSet = false; + offsetY = s.isRelative ? endValue.y : endValue.y - startPosY; + } + Vector3 pos = target.position; + pos.y += DOVirtual.EasedValue(0, offsetY, s.ElapsedDirectionalPercentage(), Ease.OutQuad); + target.position = pos; + }) ).Join(DOTween.To(() => target.position, x => target.position = x, new Vector3(0, 0, endValue.z), duration) .SetOptions(AxisConstraint.Z, snapping).SetEase(Ease.Linear) ).Join(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) ).SetTarget(target).SetEase(DOTween.defaultEaseType); - s.OnUpdate(() => { - if (!offsetYSet) { - offsetYSet = false; - offsetY = s.isRelative ? endValue.y : endValue.y - startPosY; - } - Vector3 pos = target.position; - pos.y += DOVirtual.EasedValue(0, offsetY, s.ElapsedDirectionalPercentage(), Ease.OutQuad); - target.position = pos; - }); return s; } /// Tweens a Transform's localPosition to the given value, while also applying a jump effect along the Y axis. @@ -837,24 +839,24 @@ namespace DG.Tweening float startPosY = target.localPosition.y; float offsetY = -1; bool offsetYSet = false; - Sequence s = DOTween.Sequence() - .Append(DOTween.To(() => target.localPosition, x => target.localPosition = x, new Vector3(endValue.x, 0, 0), duration) + Sequence s = DOTween.Sequence(); + s.Append(DOTween.To(() => target.localPosition, x => target.localPosition = x, new Vector3(endValue.x, 0, 0), duration) .SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear) + .OnUpdate(() => { + if (!offsetYSet) { + offsetYSet = false; + offsetY = s.isRelative ? endValue.y : endValue.y - startPosY; + } + Vector3 pos = target.localPosition; + pos.y += DOVirtual.EasedValue(0, offsetY, s.ElapsedDirectionalPercentage(), Ease.OutQuad); + target.localPosition = pos; + }) ).Join(DOTween.To(() => target.localPosition, x => target.localPosition = x, new Vector3(0, 0, endValue.z), duration) .SetOptions(AxisConstraint.Z, snapping).SetEase(Ease.Linear) ).Join(DOTween.To(() => target.localPosition, x => target.localPosition = x, new Vector3(0, jumpPower, 0), duration / (numJumps * 2)) .SetOptions(AxisConstraint.Y, snapping).SetEase(Ease.OutQuad).SetRelative() .SetLoops(numJumps * 2, LoopType.Yoyo) ).SetTarget(target).SetEase(DOTween.defaultEaseType); - s.OnUpdate(() => { - if (!offsetYSet) { - offsetYSet = false; - offsetY = s.isRelative ? endValue.y : endValue.y - startPosY; - } - Vector3 pos = target.localPosition; - pos.y += DOVirtual.EasedValue(0, offsetY, s.ElapsedDirectionalPercentage(), Ease.OutQuad); - target.localPosition = pos; - }); return s; } diff --git a/_DOTween.Assembly/DOTween/TweenSettingsExtensions.cs b/_DOTween.Assembly/DOTween/TweenSettingsExtensions.cs index d9a8ea0..c3c510b 100644 --- a/_DOTween.Assembly/DOTween/TweenSettingsExtensions.cs +++ b/_DOTween.Assembly/DOTween/TweenSettingsExtensions.cs @@ -540,8 +540,12 @@ namespace DG.Tweening { if (t == null || !t.active || t.creationLocked) return t; - t.delay = delay; - t.delayComplete = delay <= 0; + if (t.tweenType == TweenType.Sequence) { + (t as Sequence).PrependInterval(delay); + } else { + t.delay = delay; + t.delayComplete = delay <= 0; + } return t; } diff --git a/_DOTween.Assembly/DOTween43/ShortcutExtensions43.cs b/_DOTween.Assembly/DOTween43/ShortcutExtensions43.cs index 85c367f..75a7e09 100644 --- a/_DOTween.Assembly/DOTween43/ShortcutExtensions43.cs +++ b/_DOTween.Assembly/DOTween43/ShortcutExtensions43.cs @@ -105,13 +105,22 @@ namespace DG.Tweening float startPosY = target.position.y; float offsetY = -1; bool offsetYSet = false; - Sequence s = DOTween.Sequence() + Sequence s = DOTween.Sequence(); #if COMPATIBLE - .Append(DOTween.To(() => target.position, x => target.MovePosition(x.value), new Vector3(endValue.x, 0, 0), duration) + s.Append(DOTween.To(() => target.position, x => target.MovePosition(x.value), new Vector3(endValue.x, 0, 0), duration) #else - .Append(DOTween.To(() => target.position, target.MovePosition, new Vector2(endValue.x, 0), duration) + s.Append(DOTween.To(() => target.position, target.MovePosition, new Vector2(endValue.x, 0), duration) #endif .SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear) + .OnUpdate(() => { + if (!offsetYSet) { + offsetYSet = false; + offsetY = s.isRelative ? endValue.y : endValue.y - startPosY; + } + Vector2 pos = target.position; + pos.y += DOVirtual.EasedValue(0, offsetY, s.ElapsedDirectionalPercentage(), Ease.OutQuad); + target.MovePosition(pos); + }) #if COMPATIBLE ).Join(DOTween.To(() => target.position, x => target.MovePosition(x.value), new Vector3(0, jumpPower, 0), duration / (numJumps * 2)) #else @@ -120,15 +129,6 @@ namespace DG.Tweening .SetOptions(AxisConstraint.Y, snapping).SetEase(Ease.OutQuad) .SetLoops(numJumps * 2, LoopType.Yoyo).SetRelative() ).SetTarget(target).SetEase(DOTween.defaultEaseType); - s.OnUpdate(() => { - if (!offsetYSet) { - offsetYSet = false; - offsetY = s.isRelative ? endValue.y : endValue.y - startPosY; - } - Vector2 pos = target.position; - pos.y += DOVirtual.EasedValue(0, offsetY, s.ElapsedDirectionalPercentage(), Ease.OutQuad); - target.MovePosition(pos); - }); return s; } diff --git a/_DOTween.Assembly/bin/DOTween.dll b/_DOTween.Assembly/bin/DOTween.dll index 905b1ff..4210724 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 92a87fc..73b8127 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 b1e69ab..1aed027 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 d379f64..809713b 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 fd21943..ea0b871 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 41d8231..0689185 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 99b2a11..afd0c94 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 48ed5e3..4438b97 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 148ec92..7820f3b 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 b811b10..fb8c228 100644 Binary files a/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll.mdb and b/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll.mdb differ