mirror of
https://github.com/Cardidi/dotween-upm-fork.git
synced 2025-12-20 01:06:02 +08:00
SetLink: added CompleteOnDisable, CompleteAndKillOnDisable, RewindOnDisable, RewindAndKillOnDisable
This commit is contained in:
parent
c0baf69eab
commit
95f160aad2
@ -1004,6 +1004,18 @@
|
||||
<member name="F:DG.Tweening.LinkBehaviour.KillOnDestroy">
|
||||
<summary>Kills the tween when the link target is destroyed (becomes NULL). This is always active even if another behaviour is chosen</summary>
|
||||
</member>
|
||||
<member name="F:DG.Tweening.LinkBehaviour.CompleteOnDisable">
|
||||
<summary>Completes the tween when the link target is disabled</summary>
|
||||
</member>
|
||||
<member name="F:DG.Tweening.LinkBehaviour.CompleteAndKillOnDisable">
|
||||
<summary>Completes and kills the tween when the link target is disabled</summary>
|
||||
</member>
|
||||
<member name="F:DG.Tweening.LinkBehaviour.RewindOnDisable">
|
||||
<summary>Rewinds the tween (delay excluded) when the link target is disabled</summary>
|
||||
</member>
|
||||
<member name="F:DG.Tweening.LinkBehaviour.RewindAndKillOnDisable">
|
||||
<summary>Rewinds and kills the tween when the link target is disabled</summary>
|
||||
</member>
|
||||
<member name="T:DG.Tweening.PathMode">
|
||||
<summary>
|
||||
Path mode (used to determine correct LookAt orientation)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -11,14 +11,17 @@ using UnityEngine.UI;
|
||||
|
||||
public class TempTests : BrainBase
|
||||
{
|
||||
public Transform target;
|
||||
Tween t;
|
||||
Tween _tScale, _tMove;
|
||||
|
||||
IEnumerator Start()
|
||||
void Start()
|
||||
{
|
||||
target.DOBlendablePunchRotation(new Vector3(120, 120, 120), 1);
|
||||
yield return new WaitForSeconds(0.3f);
|
||||
Debug.Log(target.eulerAngles);
|
||||
target.DOBlendablePunchRotation(new Vector3(200, 200, 200), 1);
|
||||
_tScale = transform.DOScale(0.5f, 1).SetLoops(999);
|
||||
_tMove = transform.DOMoveX(2, 1).SetLoops(999);
|
||||
}
|
||||
|
||||
void OnDisable()
|
||||
{
|
||||
_tScale.Complete();
|
||||
_tMove.Complete();
|
||||
}
|
||||
}
|
||||
@ -944,7 +944,7 @@ namespace DG.Tweening.Core
|
||||
if (!_TweenLinks.TryGetValue(t, out tLink)) return;
|
||||
|
||||
if (tLink.target == null) {
|
||||
t.active = false;
|
||||
t.active = false; // Will be killed by rest of Update loop
|
||||
} else {
|
||||
bool goActive = tLink.target.activeInHierarchy;
|
||||
bool justEnabled = !tLink.lastSeenActive && goActive;
|
||||
@ -954,6 +954,22 @@ namespace DG.Tweening.Core
|
||||
case LinkBehaviour.KillOnDisable:
|
||||
if (!goActive) t.active = false; // Will be killed by rest of Update loop
|
||||
break;
|
||||
case LinkBehaviour.CompleteAndKillOnDisable:
|
||||
if (goActive) break;
|
||||
if (!t.isComplete) t.Complete();
|
||||
t.active = false; // Will be killed by rest of Update loop
|
||||
break;
|
||||
case LinkBehaviour.RewindAndKillOnDisable:
|
||||
if (goActive) break;
|
||||
t.Rewind(false);
|
||||
t.active = false; // Will be killed by rest of Update loop
|
||||
break;
|
||||
case LinkBehaviour.CompleteOnDisable:
|
||||
if (justDisabled && !t.isComplete) t.Complete();
|
||||
break;
|
||||
case LinkBehaviour.RewindOnDisable:
|
||||
if (justDisabled) t.Rewind(false);
|
||||
break;
|
||||
case LinkBehaviour.PauseOnDisable:
|
||||
if (justDisabled && t.isPlaying) Pause(t);
|
||||
break;
|
||||
|
||||
@ -34,7 +34,7 @@ namespace DG.Tweening
|
||||
public class DOTween
|
||||
{
|
||||
/// <summary>DOTween's version</summary>
|
||||
public static readonly string Version = "1.2.283"; // Last version before modules: 1.1.755
|
||||
public static readonly string Version = "1.2.290"; // Last version before modules: 1.1.755
|
||||
|
||||
///////////////////////////////////////////////
|
||||
// Options ////////////////////////////////////
|
||||
|
||||
@ -24,5 +24,13 @@ namespace DG.Tweening
|
||||
KillOnDisable,
|
||||
/// <summary>Kills the tween when the link target is destroyed (becomes NULL). This is always active even if another behaviour is chosen</summary>
|
||||
KillOnDestroy,
|
||||
/// <summary>Completes the tween when the link target is disabled</summary>
|
||||
CompleteOnDisable,
|
||||
/// <summary>Completes and kills the tween when the link target is disabled</summary>
|
||||
CompleteAndKillOnDisable,
|
||||
/// <summary>Rewinds the tween (delay excluded) when the link target is disabled</summary>
|
||||
RewindOnDisable,
|
||||
/// <summary>Rewinds and kills the tween when the link target is disabled</summary>
|
||||
RewindAndKillOnDisable,
|
||||
}
|
||||
}
|
||||
@ -1004,6 +1004,18 @@
|
||||
<member name="F:DG.Tweening.LinkBehaviour.KillOnDestroy">
|
||||
<summary>Kills the tween when the link target is destroyed (becomes NULL). This is always active even if another behaviour is chosen</summary>
|
||||
</member>
|
||||
<member name="F:DG.Tweening.LinkBehaviour.CompleteOnDisable">
|
||||
<summary>Completes the tween when the link target is disabled</summary>
|
||||
</member>
|
||||
<member name="F:DG.Tweening.LinkBehaviour.CompleteAndKillOnDisable">
|
||||
<summary>Completes and kills the tween when the link target is disabled</summary>
|
||||
</member>
|
||||
<member name="F:DG.Tweening.LinkBehaviour.RewindOnDisable">
|
||||
<summary>Rewinds the tween (delay excluded) when the link target is disabled</summary>
|
||||
</member>
|
||||
<member name="F:DG.Tweening.LinkBehaviour.RewindAndKillOnDisable">
|
||||
<summary>Rewinds and kills the tween when the link target is disabled</summary>
|
||||
</member>
|
||||
<member name="T:DG.Tweening.PathMode">
|
||||
<summary>
|
||||
Path mode (used to determine correct LookAt orientation)
|
||||
|
||||
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