mirror of
https://github.com/Cardidi/dotween-upm-fork.git
synced 2026-02-04 14:24:55 +08:00
Added tween.DOTimeScale shortcut
This commit is contained in:
parent
1a07416065
commit
f02edc07d0
1
.gitignore
vendored
1
.gitignore
vendored
@ -30,6 +30,7 @@ ExternalPluginsTestsAndExamples*
|
||||
*HOTools*
|
||||
zz builds
|
||||
zz UnityTests*
|
||||
zzTestBuilds
|
||||
*.tmp
|
||||
*.pdb
|
||||
|
||||
|
||||
@ -1705,6 +1705,11 @@
|
||||
Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints</param>
|
||||
<param name="gizmoColor">The color of the path (shown when gizmos are active in the Play panel and the tween is running)</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DOTimeScale(DG.Tweening.Tween,System.Single,System.Single)">
|
||||
<summary>Tweens a Tween's timeScale to the given value.
|
||||
Also stores the Tween as the tween's target so it can be used for filtered operations</summary>
|
||||
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DOBlendableColor(UnityEngine.Light,UnityEngine.Color,System.Single)">
|
||||
<summary>Tweens a Light's color to the given value,
|
||||
in a way that allows other DOBlendableColor tweens to work together on the same target,
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1705,6 +1705,11 @@
|
||||
Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints</param>
|
||||
<param name="gizmoColor">The color of the path (shown when gizmos are active in the Play panel and the tween is running)</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DOTimeScale(DG.Tweening.Tween,System.Single,System.Single)">
|
||||
<summary>Tweens a Tween's timeScale to the given value.
|
||||
Also stores the Tween as the tween's target so it can be used for filtered operations</summary>
|
||||
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DOBlendableColor(UnityEngine.Light,UnityEngine.Color,System.Single)">
|
||||
<summary>Tweens a Light's color to the given value,
|
||||
in a way that allows other DOBlendableColor tweens to work together on the same target,
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1705,6 +1705,11 @@
|
||||
Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints</param>
|
||||
<param name="gizmoColor">The color of the path (shown when gizmos are active in the Play panel and the tween is running)</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DOTimeScale(DG.Tweening.Tween,System.Single,System.Single)">
|
||||
<summary>Tweens a Tween's timeScale to the given value.
|
||||
Also stores the Tween as the tween's target so it can be used for filtered operations</summary>
|
||||
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DOBlendableColor(UnityEngine.Light,UnityEngine.Color,System.Single)">
|
||||
<summary>Tweens a Light's color to the given value,
|
||||
in a way that allows other DOBlendableColor tweens to work together on the same target,
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -2,7 +2,6 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Profiling;
|
||||
using UnityEditor;
|
||||
using DG.Tweening;
|
||||
|
||||
public class AllocationsTests : BrainBase
|
||||
@ -62,6 +61,8 @@ public class AllocationsTests : BrainBase
|
||||
|
||||
yield return null;
|
||||
yield return null;
|
||||
EditorApplication.isPaused = true;
|
||||
#if UNITY_EDITOR
|
||||
UnityEditor.EditorApplication.isPaused = true;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
41
UnityTests.Unity5/Assets/_Tests/DOCompletePerformance.cs
Normal file
41
UnityTests.Unity5/Assets/_Tests/DOCompletePerformance.cs
Normal file
@ -0,0 +1,41 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using DG.Tweening;
|
||||
|
||||
public class DOCompletePerformance : BrainBase
|
||||
{
|
||||
public int totTweens = 500;
|
||||
public Transform target;
|
||||
public float floatValue;
|
||||
|
||||
IEnumerator CO_TestDOCompleteBy(bool byTarget, bool tweenFloatValue)
|
||||
{
|
||||
Debug.Log(Time.realtimeSinceStartup + " :: Create " + totTweens + " tweens on " + (tweenFloatValue ? "float" : "transform"));
|
||||
for (int i = 0; i < totTweens; ++i) {
|
||||
Tween t = tweenFloatValue
|
||||
? DOTween.To(()=> floatValue, x=> floatValue = x, 2, 10)
|
||||
: target.DOMoveX(2, 10);
|
||||
if (!byTarget) t.SetId("myId");
|
||||
else if (tweenFloatValue) t.SetTarget(target);
|
||||
}
|
||||
yield return new WaitForSeconds(2f);
|
||||
|
||||
Debug.Log(Time.realtimeSinceStartup + " :: Complete " + totTweens + " tweens by " + (byTarget ? "target" : "id"));
|
||||
float time = Time.realtimeSinceStartup;
|
||||
if (byTarget) target.DOComplete();
|
||||
else DOTween.Complete("myId");
|
||||
float elapsed = Time.realtimeSinceStartup - time;
|
||||
Debug.Log(Time.realtimeSinceStartup + " :: Completed " + totTweens + " tweens in " + elapsed + " seconds");
|
||||
}
|
||||
|
||||
public void TestDOCompleteBy_Transform(bool byTarget)
|
||||
{
|
||||
this.StartCoroutine(CO_TestDOCompleteBy(byTarget, false));
|
||||
}
|
||||
|
||||
public void TestDOCompleteBy_Float(bool byTarget)
|
||||
{
|
||||
this.StartCoroutine(CO_TestDOCompleteBy(byTarget, true));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cd40d6554c2a80a49ae8a6bec36d3f36
|
||||
timeCreated: 1492075506
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
UnityTests.Unity5/Assets/_Tests/DOCompletePerformance.unity
Normal file
BIN
UnityTests.Unity5/Assets/_Tests/DOCompletePerformance.unity
Normal file
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fb9f65f43cd9b5345b3b809429db650a
|
||||
timeCreated: 1492075490
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -5,9 +5,7 @@ using System.Reflection;
|
||||
using DG.Tweening;
|
||||
using DG.Tweening.Core;
|
||||
using DG.Tweening.Plugins.Options;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class TempTests : BrainBase
|
||||
{
|
||||
@ -15,7 +13,7 @@ public class TempTests : BrainBase
|
||||
public Ease ease;
|
||||
|
||||
// Use this for initialization
|
||||
IEnumerator Start ()
|
||||
IEnumerator Start ()
|
||||
{
|
||||
yield return new WaitForSeconds(1);
|
||||
Tween t = target.DOMoveX(60000, 200).SetEase(ease);
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@ -1 +1 @@
|
||||
m_EditorVersion: 5.5.1f1
|
||||
m_EditorVersion: 5.6.0f3
|
||||
|
||||
@ -32,7 +32,7 @@ namespace DG.Tweening
|
||||
public class DOTween
|
||||
{
|
||||
/// <summary>DOTween's version</summary>
|
||||
public static readonly string Version = "1.1.575";
|
||||
public static readonly string Version = "1.1.580";
|
||||
|
||||
///////////////////////////////////////////////
|
||||
// Options ////////////////////////////////////
|
||||
|
||||
@ -1043,13 +1043,25 @@ namespace DG.Tweening
|
||||
return t;
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Blendables
|
||||
#region Tween
|
||||
|
||||
#region Light
|
||||
/// <summary>Tweens a Tween's timeScale to the given value.
|
||||
/// Also stores the Tween as the tween's target so it can be used for filtered operations</summary>
|
||||
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||
public static Tweener DOTimeScale(this Tween target, float endValue, float duration)
|
||||
{
|
||||
return DOTween.To(() => target.timeScale, x => target.timeScale = x, endValue, duration).SetTarget(target);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Blendables
|
||||
|
||||
#region Light
|
||||
|
||||
/// <summary>Tweens a Light's color to the given value,
|
||||
/// in a way that allows other DOBlendableColor tweens to work together on the same target,
|
||||
|
||||
@ -1705,6 +1705,11 @@
|
||||
Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints</param>
|
||||
<param name="gizmoColor">The color of the path (shown when gizmos are active in the Play panel and the tween is running)</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DOTimeScale(DG.Tweening.Tween,System.Single,System.Single)">
|
||||
<summary>Tweens a Tween's timeScale to the given value.
|
||||
Also stores the Tween as the tween's target so it can be used for filtered operations</summary>
|
||||
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DOBlendableColor(UnityEngine.Light,UnityEngine.Color,System.Single)">
|
||||
<summary>Tweens a Light's color to the given value,
|
||||
in a way that allows other DOBlendableColor tweens to work together on the same target,
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user