mirror of
https://github.com/Cardidi/dotween-upm-fork.git
synced 2025-12-20 09:16:02 +08:00
Fixed SetDelay method so that it works correctly with named parameters
This commit is contained in:
parent
15400e5ba3
commit
1242c008c4
@ -390,9 +390,13 @@
|
||||
<summary>Sets the update type to UpdateType.Normal and lets you choose if it should be independent from Unity's Time.timeScale</summary>
|
||||
<param name="isIndependentUpdate">If TRUE the tween will ignore Unity's Time.timeScale</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.TweenSettingsExtensions.SetUpdate``1(``0,DG.Tweening.UpdateType,System.Boolean)">
|
||||
<summary>Sets the type of update (default or independent) for the tween</summary>
|
||||
<member name="M:DG.Tweening.TweenSettingsExtensions.SetUpdate``1(``0,DG.Tweening.UpdateType)">
|
||||
<summary>Sets the type of update for the tween</summary>
|
||||
<param name="updateType">The type of update (defalt: UpdateType.Normal)</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.TweenSettingsExtensions.SetUpdate``1(``0,DG.Tweening.UpdateType,System.Boolean)">
|
||||
<summary>Sets the type of update for the tween and lets you choose if it should be independent from Unity's Time.timeScale</summary>
|
||||
<param name="updateType">The type of update</param>
|
||||
<param name="isIndependentUpdate">If TRUE the tween will ignore Unity's Time.timeScale</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.TweenSettingsExtensions.OnStart``1(``0,DG.Tweening.TweenCallback)">
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@ -390,9 +390,13 @@
|
||||
<summary>Sets the update type to UpdateType.Normal and lets you choose if it should be independent from Unity's Time.timeScale</summary>
|
||||
<param name="isIndependentUpdate">If TRUE the tween will ignore Unity's Time.timeScale</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.TweenSettingsExtensions.SetUpdate``1(``0,DG.Tweening.UpdateType,System.Boolean)">
|
||||
<summary>Sets the type of update (default or independent) for the tween</summary>
|
||||
<member name="M:DG.Tweening.TweenSettingsExtensions.SetUpdate``1(``0,DG.Tweening.UpdateType)">
|
||||
<summary>Sets the type of update for the tween</summary>
|
||||
<param name="updateType">The type of update (defalt: UpdateType.Normal)</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.TweenSettingsExtensions.SetUpdate``1(``0,DG.Tweening.UpdateType,System.Boolean)">
|
||||
<summary>Sets the type of update for the tween and lets you choose if it should be independent from Unity's Time.timeScale</summary>
|
||||
<param name="updateType">The type of update</param>
|
||||
<param name="isIndependentUpdate">If TRUE the tween will ignore Unity's Time.timeScale</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.TweenSettingsExtensions.OnStart``1(``0,DG.Tweening.TweenCallback)">
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@ -390,9 +390,13 @@
|
||||
<summary>Sets the update type to UpdateType.Normal and lets you choose if it should be independent from Unity's Time.timeScale</summary>
|
||||
<param name="isIndependentUpdate">If TRUE the tween will ignore Unity's Time.timeScale</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.TweenSettingsExtensions.SetUpdate``1(``0,DG.Tweening.UpdateType,System.Boolean)">
|
||||
<summary>Sets the type of update (default or independent) for the tween</summary>
|
||||
<member name="M:DG.Tweening.TweenSettingsExtensions.SetUpdate``1(``0,DG.Tweening.UpdateType)">
|
||||
<summary>Sets the type of update for the tween</summary>
|
||||
<param name="updateType">The type of update (defalt: UpdateType.Normal)</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.TweenSettingsExtensions.SetUpdate``1(``0,DG.Tweening.UpdateType,System.Boolean)">
|
||||
<summary>Sets the type of update for the tween and lets you choose if it should be independent from Unity's Time.timeScale</summary>
|
||||
<param name="updateType">The type of update</param>
|
||||
<param name="isIndependentUpdate">If TRUE the tween will ignore Unity's Time.timeScale</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.TweenSettingsExtensions.OnStart``1(``0,DG.Tweening.TweenCallback)">
|
||||
|
||||
Binary file not shown.
Binary file not shown.
36
UnityTests.Unity5/Assets/_Tests/Bugs/NamedParameters.cs
Normal file
36
UnityTests.Unity5/Assets/_Tests/Bugs/NamedParameters.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using DG.Tweening;
|
||||
|
||||
public class NamedParameters : BrainBase
|
||||
{
|
||||
public Transform target;
|
||||
|
||||
void Start()
|
||||
{
|
||||
// target.DOMoveX(4, 1).SetUpdate(updateType: UpdateType.Normal, isIndependentUpdate: true);
|
||||
target.DOMoveX(4, 1).SetUpdate(isIndependentUpdate: true);
|
||||
LogSomething(alog: "passed");
|
||||
target.Log(msg: "t passed");
|
||||
}
|
||||
|
||||
void LogSomething(string alog = "default")
|
||||
{
|
||||
Debug.Log(alog);
|
||||
}
|
||||
}
|
||||
|
||||
public static class Exts
|
||||
{
|
||||
public static T Log<T>(this T t, string msg) where T : Transform
|
||||
{
|
||||
Debug.Log(t + " > " + msg);
|
||||
return t;
|
||||
}
|
||||
|
||||
public static T Log<T>(this T t, int i = 10, string msg = "default") where T : Transform
|
||||
{
|
||||
Debug.Log(t + " > " + i + ": " + msg);
|
||||
return t;
|
||||
}
|
||||
}
|
||||
12
UnityTests.Unity5/Assets/_Tests/Bugs/NamedParameters.cs.meta
Normal file
12
UnityTests.Unity5/Assets/_Tests/Bugs/NamedParameters.cs.meta
Normal file
@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3a9e20ae0ab5638489fbb3fd3b7814c7
|
||||
timeCreated: 1430218646
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
UnityTests.Unity5/Assets/_Tests/Bugs/NamedParameters.unity
Normal file
BIN
UnityTests.Unity5/Assets/_Tests/Bugs/NamedParameters.unity
Normal file
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 60ec5a97972b0cf43b45337ac0775005
|
||||
timeCreated: 1430218638
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -6,20 +6,16 @@ using System.Collections;
|
||||
|
||||
public class Temp : BrainBase
|
||||
{
|
||||
public float lastStepDuration = 0.4f; // 0.4 doesn't work, 0.2 does
|
||||
public Transform[] targets;
|
||||
|
||||
void Start()
|
||||
{
|
||||
DOTween.Init();
|
||||
|
||||
Sequence timeline = DOTween.Sequence();
|
||||
DOGetter<int> emptyGetter = () => 0;
|
||||
DOSetter<int> emptySetter = value => { };
|
||||
|
||||
timeline.Append(DOTween.To(emptyGetter, emptySetter, 0, 0.2f).OnComplete(() => Debug.LogWarning("step1")));
|
||||
timeline.Append(DOTween.To(emptyGetter, emptySetter, 0, 0.2f).OnComplete(() => Debug.LogWarning("step2")));
|
||||
timeline.Append(DOTween.To(emptyGetter, emptySetter, 0, 0.4f).OnComplete(() => Debug.LogWarning("step3")));
|
||||
timeline.Append(DOTween.To(emptyGetter, emptySetter, 0, 0.2f).OnComplete(() => Debug.LogWarning("step4")));
|
||||
timeline.Append(DOTween.To(emptyGetter, emptySetter, 0, lastStepDuration).SetId("last").OnComplete(() => Debug.LogWarning("step5"))).OnComplete(() => Debug.LogWarning("timeline"));
|
||||
for (int i = 0; i < targets.Length; ++i) {
|
||||
Transform t = targets[i];
|
||||
Tweener tween = t.DOLocalMove(Vector3.zero, 1).SetLoops(4, LoopType.Restart).SetEase(Ease.Linear);
|
||||
float time = ((i+1) / (float)targets.Length);
|
||||
t.GetComponentInChildren<TextMesh>().text = i + "-" + time;
|
||||
tween.Goto(time, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@ -32,7 +32,7 @@ namespace DG.Tweening
|
||||
public class DOTween
|
||||
{
|
||||
/// <summary>DOTween's version</summary>
|
||||
public static readonly string Version = "1.0.625";
|
||||
public static readonly string Version = "1.0.630";
|
||||
|
||||
///////////////////////////////////////////////
|
||||
// Options ////////////////////////////////////
|
||||
|
||||
@ -198,10 +198,19 @@ namespace DG.Tweening
|
||||
TweenManager.SetUpdateType(t, DOTween.defaultUpdateType, isIndependentUpdate);
|
||||
return t;
|
||||
}
|
||||
/// <summary>Sets the type of update (default or independent) for the tween</summary>
|
||||
/// <summary>Sets the type of update for the tween</summary>
|
||||
/// <param name="updateType">The type of update (defalt: UpdateType.Normal)</param>
|
||||
public static T SetUpdate<T>(this T t, UpdateType updateType) where T : Tween
|
||||
{
|
||||
if (t == null || !t.active) return t;
|
||||
|
||||
TweenManager.SetUpdateType(t, updateType, DOTween.defaultTimeScaleIndependent);
|
||||
return t;
|
||||
}
|
||||
/// <summary>Sets the type of update for the tween and lets you choose if it should be independent from Unity's Time.timeScale</summary>
|
||||
/// <param name="updateType">The type of update</param>
|
||||
/// <param name="isIndependentUpdate">If TRUE the tween will ignore Unity's Time.timeScale</param>
|
||||
public static T SetUpdate<T>(this T t, UpdateType updateType, bool isIndependentUpdate = false) where T : Tween
|
||||
public static T SetUpdate<T>(this T t, UpdateType updateType, bool isIndependentUpdate) where T : Tween
|
||||
{
|
||||
if (t == null || !t.active) return t;
|
||||
|
||||
|
||||
@ -390,9 +390,13 @@
|
||||
<summary>Sets the update type to UpdateType.Normal and lets you choose if it should be independent from Unity's Time.timeScale</summary>
|
||||
<param name="isIndependentUpdate">If TRUE the tween will ignore Unity's Time.timeScale</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.TweenSettingsExtensions.SetUpdate``1(``0,DG.Tweening.UpdateType,System.Boolean)">
|
||||
<summary>Sets the type of update (default or independent) for the tween</summary>
|
||||
<member name="M:DG.Tweening.TweenSettingsExtensions.SetUpdate``1(``0,DG.Tweening.UpdateType)">
|
||||
<summary>Sets the type of update for the tween</summary>
|
||||
<param name="updateType">The type of update (defalt: UpdateType.Normal)</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.TweenSettingsExtensions.SetUpdate``1(``0,DG.Tweening.UpdateType,System.Boolean)">
|
||||
<summary>Sets the type of update for the tween and lets you choose if it should be independent from Unity's Time.timeScale</summary>
|
||||
<param name="updateType">The type of update</param>
|
||||
<param name="isIndependentUpdate">If TRUE the tween will ignore Unity's Time.timeScale</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.TweenSettingsExtensions.OnStart``1(``0,DG.Tweening.TweenCallback)">
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user