1
0
mirror of https://github.com/Cardidi/dotween-upm-fork.git synced 2025-12-20 17:26:03 +08:00

Fixed OnPlay not being called on Restart

This commit is contained in:
Demigiant 2015-08-08 23:10:03 +02:00
parent 13c933a4b8
commit 599398b1ce
61 changed files with 53 additions and 414 deletions

View File

@ -532,7 +532,7 @@
<member name="M:DG.Tweening.DOTween.Complete(System.Object,System.Boolean)"> <member name="M:DG.Tweening.DOTween.Complete(System.Object,System.Boolean)">
<summary>Completes all tweens with the given ID or target and returns the number of actual tweens completed <summary>Completes all tweens with the given ID or target and returns the number of actual tweens completed
(meaning the tweens that don't have infinite loops and were not already complete)</summary> (meaning the tweens that don't have infinite loops and were not already complete)</summary>
<param name="withCallbacks">For Sequences only: if TRUE also internal Sequence callbacks will be fired, <param name="withCallbacks">For Sequences only: if TRUE internal Sequence callbacks will be fired,
otherwise they will be ignored</param> otherwise they will be ignored</param>
</member> </member>
<member name="M:DG.Tweening.DOTween.FlipAll"> <member name="M:DG.Tweening.DOTween.FlipAll">

View File

@ -1,65 +0,0 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>DOTweenEditor</name>
</assembly>
<members>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.SetEditorTexture(UnityEngine.Texture2D,UnityEngine.FilterMode,System.Int32)">
<summary>
Checks that the given editor texture use the correct import settings,
and applies them if they're incorrect.
</summary>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.DOTweenSetupRequired">
<summary>
Returns TRUE if addons setup is required.
</summary>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.AssetExists(System.String)">
<summary>
Returns TRUE if the file/directory at the given path exists.
</summary>
<param name="adbPath">Path, relative to Unity's project folder</param>
<returns></returns>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.ADBPathToFullPath(System.String)">
<summary>
Converts the given project-relative path to a full path,
with backward (\) slashes).
</summary>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.FullPathToADBPath(System.String)">
<summary>
Converts the given full path to a path usable with AssetDatabase methods
(relative to Unity's project folder, and with the correct Unity forward (/) slashes).
</summary>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.ConnectToSourceAsset``1(System.String,System.Boolean)">
<summary>
Connects to a <see cref="T:UnityEngine.ScriptableObject"/> asset.
If the asset already exists at the given path, loads it and returns it.
Otherwise, either returns NULL or automatically creates it before loading and returning it
(depending on the given parameters).
</summary>
<typeparam name="T">Asset type</typeparam>
<param name="adbFilePath">File path (relative to Unity's project folder)</param>
<param name="createIfMissing">If TRUE and the requested asset doesn't exist, forces its creation</param>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.GetAssemblyFilePath(System.Reflection.Assembly)">
<summary>
Full path for the given loaded assembly, assembly file included
</summary>
</member>
<member name="T:DG.DOTweenEditor.DOTweenSetupMenuItem">
<summary>
Not used as menu item anymore, but as a utiity function
</summary>
</member>
<member name="M:DG.DOTweenEditor.DOTweenSetupMenuItem.Setup(System.Boolean)">
<summary>
Setups DOTween
</summary>
<param name="partiallySilent">If TRUE, no warning window appears in case there is no need for setup</param>
</member>
</members>
</doc>

View File

@ -1,65 +0,0 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>DOTweenEditor</name>
</assembly>
<members>
<member name="T:DG.DOTweenEditor.DOTweenSetupMenuItem">
<summary>
Not used as menu item anymore, but as a utiity function
</summary>
</member>
<member name="M:DG.DOTweenEditor.DOTweenSetupMenuItem.Setup(System.Boolean)">
<summary>
Setups DOTween
</summary>
<param name="partiallySilent">If TRUE, no warning window appears in case there is no need for setup</param>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.SetEditorTexture(UnityEngine.Texture2D,UnityEngine.FilterMode,System.Int32)">
<summary>
Checks that the given editor texture use the correct import settings,
and applies them if they're incorrect.
</summary>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.DOTweenSetupRequired">
<summary>
Returns TRUE if addons setup is required.
</summary>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.AssetExists(System.String)">
<summary>
Returns TRUE if the file/directory at the given path exists.
</summary>
<param name="adbPath">Path, relative to Unity's project folder</param>
<returns></returns>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.ADBPathToFullPath(System.String)">
<summary>
Converts the given project-relative path to a full path,
with backward (\) slashes).
</summary>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.FullPathToADBPath(System.String)">
<summary>
Converts the given full path to a path usable with AssetDatabase methods
(relative to Unity's project folder, and with the correct Unity forward (/) slashes).
</summary>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.ConnectToSourceAsset``1(System.String,System.Boolean)">
<summary>
Connects to a <see cref="T:UnityEngine.ScriptableObject"/> asset.
If the asset already exists at the given path, loads it and returns it.
Otherwise, either returns NULL or automatically creates it before loading and returning it
(depending on the given parameters).
</summary>
<typeparam name="T">Asset type</typeparam>
<param name="adbFilePath">File path (relative to Unity's project folder)</param>
<param name="createIfMissing">If TRUE and the requested asset doesn't exist, forces its creation</param>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.GetAssemblyFilePath(System.Reflection.Assembly)">
<summary>
Full path for the given loaded assembly, assembly file included
</summary>
</member>
</members>
</doc>

View File

@ -532,7 +532,7 @@
<member name="M:DG.Tweening.DOTween.Complete(System.Object,System.Boolean)"> <member name="M:DG.Tweening.DOTween.Complete(System.Object,System.Boolean)">
<summary>Completes all tweens with the given ID or target and returns the number of actual tweens completed <summary>Completes all tweens with the given ID or target and returns the number of actual tweens completed
(meaning the tweens that don't have infinite loops and were not already complete)</summary> (meaning the tweens that don't have infinite loops and were not already complete)</summary>
<param name="withCallbacks">For Sequences only: if TRUE also internal Sequence callbacks will be fired, <param name="withCallbacks">For Sequences only: if TRUE internal Sequence callbacks will be fired,
otherwise they will be ignored</param> otherwise they will be ignored</param>
</member> </member>
<member name="M:DG.Tweening.DOTween.FlipAll"> <member name="M:DG.Tweening.DOTween.FlipAll">

View File

@ -1,65 +0,0 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>DOTweenEditor</name>
</assembly>
<members>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.SetEditorTexture(UnityEngine.Texture2D,UnityEngine.FilterMode,System.Int32)">
<summary>
Checks that the given editor texture use the correct import settings,
and applies them if they're incorrect.
</summary>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.DOTweenSetupRequired">
<summary>
Returns TRUE if addons setup is required.
</summary>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.AssetExists(System.String)">
<summary>
Returns TRUE if the file/directory at the given path exists.
</summary>
<param name="adbPath">Path, relative to Unity's project folder</param>
<returns></returns>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.ADBPathToFullPath(System.String)">
<summary>
Converts the given project-relative path to a full path,
with backward (\) slashes).
</summary>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.FullPathToADBPath(System.String)">
<summary>
Converts the given full path to a path usable with AssetDatabase methods
(relative to Unity's project folder, and with the correct Unity forward (/) slashes).
</summary>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.ConnectToSourceAsset``1(System.String,System.Boolean)">
<summary>
Connects to a <see cref="T:UnityEngine.ScriptableObject"/> asset.
If the asset already exists at the given path, loads it and returns it.
Otherwise, either returns NULL or automatically creates it before loading and returning it
(depending on the given parameters).
</summary>
<typeparam name="T">Asset type</typeparam>
<param name="adbFilePath">File path (relative to Unity's project folder)</param>
<param name="createIfMissing">If TRUE and the requested asset doesn't exist, forces its creation</param>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.GetAssemblyFilePath(System.Reflection.Assembly)">
<summary>
Full path for the given loaded assembly, assembly file included
</summary>
</member>
<member name="T:DG.DOTweenEditor.DOTweenSetupMenuItem">
<summary>
Not used as menu item anymore, but as a utiity function
</summary>
</member>
<member name="M:DG.DOTweenEditor.DOTweenSetupMenuItem.Setup(System.Boolean)">
<summary>
Setups DOTween
</summary>
<param name="partiallySilent">If TRUE, no warning window appears in case there is no need for setup</param>
</member>
</members>
</doc>

View File

@ -1,65 +0,0 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>DOTweenEditor</name>
</assembly>
<members>
<member name="T:DG.DOTweenEditor.DOTweenSetupMenuItem">
<summary>
Not used as menu item anymore, but as a utiity function
</summary>
</member>
<member name="M:DG.DOTweenEditor.DOTweenSetupMenuItem.Setup(System.Boolean)">
<summary>
Setups DOTween
</summary>
<param name="partiallySilent">If TRUE, no warning window appears in case there is no need for setup</param>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.SetEditorTexture(UnityEngine.Texture2D,UnityEngine.FilterMode,System.Int32)">
<summary>
Checks that the given editor texture use the correct import settings,
and applies them if they're incorrect.
</summary>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.DOTweenSetupRequired">
<summary>
Returns TRUE if addons setup is required.
</summary>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.AssetExists(System.String)">
<summary>
Returns TRUE if the file/directory at the given path exists.
</summary>
<param name="adbPath">Path, relative to Unity's project folder</param>
<returns></returns>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.ADBPathToFullPath(System.String)">
<summary>
Converts the given project-relative path to a full path,
with backward (\) slashes).
</summary>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.FullPathToADBPath(System.String)">
<summary>
Converts the given full path to a path usable with AssetDatabase methods
(relative to Unity's project folder, and with the correct Unity forward (/) slashes).
</summary>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.ConnectToSourceAsset``1(System.String,System.Boolean)">
<summary>
Connects to a <see cref="T:UnityEngine.ScriptableObject"/> asset.
If the asset already exists at the given path, loads it and returns it.
Otherwise, either returns NULL or automatically creates it before loading and returning it
(depending on the given parameters).
</summary>
<typeparam name="T">Asset type</typeparam>
<param name="adbFilePath">File path (relative to Unity's project folder)</param>
<param name="createIfMissing">If TRUE and the requested asset doesn't exist, forces its creation</param>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.GetAssemblyFilePath(System.Reflection.Assembly)">
<summary>
Full path for the given loaded assembly, assembly file included
</summary>
</member>
</members>
</doc>

View File

@ -532,7 +532,7 @@
<member name="M:DG.Tweening.DOTween.Complete(System.Object,System.Boolean)"> <member name="M:DG.Tweening.DOTween.Complete(System.Object,System.Boolean)">
<summary>Completes all tweens with the given ID or target and returns the number of actual tweens completed <summary>Completes all tweens with the given ID or target and returns the number of actual tweens completed
(meaning the tweens that don't have infinite loops and were not already complete)</summary> (meaning the tweens that don't have infinite loops and were not already complete)</summary>
<param name="withCallbacks">For Sequences only: if TRUE also internal Sequence callbacks will be fired, <param name="withCallbacks">For Sequences only: if TRUE internal Sequence callbacks will be fired,
otherwise they will be ignored</param> otherwise they will be ignored</param>
</member> </member>
<member name="M:DG.Tweening.DOTween.FlipAll"> <member name="M:DG.Tweening.DOTween.FlipAll">

View File

@ -1,65 +0,0 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>DOTweenEditor</name>
</assembly>
<members>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.SetEditorTexture(UnityEngine.Texture2D,UnityEngine.FilterMode,System.Int32)">
<summary>
Checks that the given editor texture use the correct import settings,
and applies them if they're incorrect.
</summary>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.DOTweenSetupRequired">
<summary>
Returns TRUE if addons setup is required.
</summary>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.AssetExists(System.String)">
<summary>
Returns TRUE if the file/directory at the given path exists.
</summary>
<param name="adbPath">Path, relative to Unity's project folder</param>
<returns></returns>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.ADBPathToFullPath(System.String)">
<summary>
Converts the given project-relative path to a full path,
with backward (\) slashes).
</summary>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.FullPathToADBPath(System.String)">
<summary>
Converts the given full path to a path usable with AssetDatabase methods
(relative to Unity's project folder, and with the correct Unity forward (/) slashes).
</summary>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.ConnectToSourceAsset``1(System.String,System.Boolean)">
<summary>
Connects to a <see cref="T:UnityEngine.ScriptableObject"/> asset.
If the asset already exists at the given path, loads it and returns it.
Otherwise, either returns NULL or automatically creates it before loading and returning it
(depending on the given parameters).
</summary>
<typeparam name="T">Asset type</typeparam>
<param name="adbFilePath">File path (relative to Unity's project folder)</param>
<param name="createIfMissing">If TRUE and the requested asset doesn't exist, forces its creation</param>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.GetAssemblyFilePath(System.Reflection.Assembly)">
<summary>
Full path for the given loaded assembly, assembly file included
</summary>
</member>
<member name="T:DG.DOTweenEditor.DOTweenSetupMenuItem">
<summary>
Not used as menu item anymore, but as a utiity function
</summary>
</member>
<member name="M:DG.DOTweenEditor.DOTweenSetupMenuItem.Setup(System.Boolean)">
<summary>
Setups DOTween
</summary>
<param name="partiallySilent">If TRUE, no warning window appears in case there is no need for setup</param>
</member>
</members>
</doc>

View File

@ -1,65 +0,0 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>DOTweenEditor</name>
</assembly>
<members>
<member name="T:DG.DOTweenEditor.DOTweenSetupMenuItem">
<summary>
Not used as menu item anymore, but as a utiity function
</summary>
</member>
<member name="M:DG.DOTweenEditor.DOTweenSetupMenuItem.Setup(System.Boolean)">
<summary>
Setups DOTween
</summary>
<param name="partiallySilent">If TRUE, no warning window appears in case there is no need for setup</param>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.SetEditorTexture(UnityEngine.Texture2D,UnityEngine.FilterMode,System.Int32)">
<summary>
Checks that the given editor texture use the correct import settings,
and applies them if they're incorrect.
</summary>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.DOTweenSetupRequired">
<summary>
Returns TRUE if addons setup is required.
</summary>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.AssetExists(System.String)">
<summary>
Returns TRUE if the file/directory at the given path exists.
</summary>
<param name="adbPath">Path, relative to Unity's project folder</param>
<returns></returns>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.ADBPathToFullPath(System.String)">
<summary>
Converts the given project-relative path to a full path,
with backward (\) slashes).
</summary>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.FullPathToADBPath(System.String)">
<summary>
Converts the given full path to a path usable with AssetDatabase methods
(relative to Unity's project folder, and with the correct Unity forward (/) slashes).
</summary>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.ConnectToSourceAsset``1(System.String,System.Boolean)">
<summary>
Connects to a <see cref="T:UnityEngine.ScriptableObject"/> asset.
If the asset already exists at the given path, loads it and returns it.
Otherwise, either returns NULL or automatically creates it before loading and returning it
(depending on the given parameters).
</summary>
<typeparam name="T">Asset type</typeparam>
<param name="adbFilePath">File path (relative to Unity's project folder)</param>
<param name="createIfMissing">If TRUE and the requested asset doesn't exist, forces its creation</param>
</member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.GetAssemblyFilePath(System.Reflection.Assembly)">
<summary>
Full path for the given loaded assembly, assembly file included
</summary>
</member>
</members>
</doc>

View File

@ -4,11 +4,10 @@ using DG.Tweening;
public class TempPro : MonoBehaviour public class TempPro : MonoBehaviour
{ {
public Transform target; public DOTweenAnimation anime;
public Vector3[] path;
void Start() void Update()
{ {
target.DOPath(path, 4); if (Input.GetKeyDown(KeyCode.Space)) anime.DORestart(true);
} }
} }

View File

@ -0,0 +1,14 @@
using UnityEngine;
using System.Collections;
using DG.Tweening;
public class NegativeTimeScale : MonoBehaviour
{
public Transform target;
void Start()
{
Tween t = target.DOMoveX(7, 4).SetRelative().SetLoops(-1, LoopType.Yoyo);
t.OnUpdate(()=> t.timeScale = 1);
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 1b8b3dcb0e1f5444590686bff0fa7476
timeCreated: 1438868958
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d6abc76f2551e2f46918676a86d990b8
timeCreated: 1438868947
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -10,21 +10,17 @@ using UnityEngine.UI;
public class TempTests : BrainBase public class TempTests : BrainBase
{ {
public Transform target; public Transform target;
public float delay = 0; Tween tween;
IEnumerator Start() void Start()
{ {
Vector3[] wps = new[] { tween = target.DOMoveX(2, 1).SetAutoKill(false).OnPlay(()=> Debug.Log("Play"));
new Vector3(-9.9f, -4.9f, 15.0f), new Vector3(-9.9f, -2.4f, 10.0f), new Vector3(-9.9f, 2.7f, 10.0f), new Vector3(-9.9f, 5.2f, 15.0f) }
};
Tween t = target.DOPath(wps, 4).SetEase(Ease.Linear).Pause();
yield return new WaitForSeconds(1); void OnGUI()
t.Goto(1); {
Debug.Log("1 " + target.position); if (GUILayout.Button("Restart")) tween.Restart();
if (GUILayout.Button("Flip")) tween.Flip();
yield return new WaitForSeconds(2); if (GUILayout.Button("TogglePause")) tween.TogglePause();
t.Goto(2);
Debug.Log("2 " + target.position);
} }
} }

View File

@ -603,7 +603,7 @@ namespace DG.Tweening.Core
internal static bool Restart(Tween t, bool includeDelay = true) internal static bool Restart(Tween t, bool includeDelay = true)
{ {
bool wasPaused = t.isPlaying; bool wasPaused = !t.isPlaying;
t.isBackwards = false; t.isBackwards = false;
Rewind(t, includeDelay); Rewind(t, includeDelay);
t.isPlaying = true; t.isPlaying = true;

View File

@ -32,7 +32,7 @@ namespace DG.Tweening
public class DOTween public class DOTween
{ {
/// <summary>DOTween's version</summary> /// <summary>DOTween's version</summary>
public static readonly string Version = "1.0.810"; public static readonly string Version = "1.0.815";
/////////////////////////////////////////////// ///////////////////////////////////////////////
// Options //////////////////////////////////// // Options ////////////////////////////////////
@ -638,7 +638,7 @@ namespace DG.Tweening
} }
/// <summary>Completes all tweens with the given ID or target and returns the number of actual tweens completed /// <summary>Completes all tweens with the given ID or target and returns the number of actual tweens completed
/// (meaning the tweens that don't have infinite loops and were not already complete)</summary> /// (meaning the tweens that don't have infinite loops and were not already complete)</summary>
/// <param name="withCallbacks">For Sequences only: if TRUE also internal Sequence callbacks will be fired, /// <param name="withCallbacks">For Sequences only: if TRUE internal Sequence callbacks will be fired,
/// otherwise they will be ignored</param> /// otherwise they will be ignored</param>
public static int Complete(object targetOrId, bool withCallbacks = false) public static int Complete(object targetOrId, bool withCallbacks = false)
{ {

View File

@ -532,7 +532,7 @@
<member name="M:DG.Tweening.DOTween.Complete(System.Object,System.Boolean)"> <member name="M:DG.Tweening.DOTween.Complete(System.Object,System.Boolean)">
<summary>Completes all tweens with the given ID or target and returns the number of actual tweens completed <summary>Completes all tweens with the given ID or target and returns the number of actual tweens completed
(meaning the tweens that don't have infinite loops and were not already complete)</summary> (meaning the tweens that don't have infinite loops and were not already complete)</summary>
<param name="withCallbacks">For Sequences only: if TRUE also internal Sequence callbacks will be fired, <param name="withCallbacks">For Sequences only: if TRUE internal Sequence callbacks will be fired,
otherwise they will be ignored</param> otherwise they will be ignored</param>
</member> </member>
<member name="M:DG.Tweening.DOTween.FlipAll"> <member name="M:DG.Tweening.DOTween.FlipAll">

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.