mirror of
https://github.com/Cardidi/dotween-upm-fork.git
synced 2025-12-20 17:26:03 +08:00
Added "alsoCheckIfIsPlaying" parameter to DOTween.IsTweening
This commit is contained in:
parent
5922a852a4
commit
94c2faae8f
@ -693,14 +693,17 @@
|
|||||||
<summary>Toggles the play state of all tweens with the given ID or target and returns the number of actual tweens toggled
|
<summary>Toggles the play state of all tweens with the given ID or target and returns the number of actual tweens toggled
|
||||||
(meaning the tweens that could be played or paused, depending on the toggle state)</summary>
|
(meaning the tweens that could be played or paused, depending on the toggle state)</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:DG.Tweening.DOTween.IsTweening(System.Object)">
|
<member name="M:DG.Tweening.DOTween.IsTweening(System.Object,System.Boolean)">
|
||||||
<summary>
|
<summary>
|
||||||
Returns TRUE if a tween with the given ID or target is active (regardless if it's playing or not).
|
Returns TRUE if a tween with the given ID or target is active.
|
||||||
<para>You can also use this to know if a shortcut tween is active for a given target.</para>
|
<para>You can also use this to know if a shortcut tween is active for a given target.</para>
|
||||||
<para>Example:</para>
|
<para>Example:</para>
|
||||||
<para><code>transform.DOMoveX(45, 1); // transform is automatically added as the tween target</code></para>
|
<para><code>transform.DOMoveX(45, 1); // transform is automatically added as the tween target</code></para>
|
||||||
<para><code>DOTween.IsTweening(transform); // Returns true</code></para>
|
<para><code>DOTween.IsTweening(transform); // Returns true</code></para>
|
||||||
</summary>
|
</summary>
|
||||||
|
<param name="targetOrId">The target or ID to look for</param>
|
||||||
|
<param name="alsoCheckIfIsPlaying">If FALSE (default) returns TRUE as long as a tween for the given target/ID is active,
|
||||||
|
otherwise also requires it to be playing</param>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:DG.Tweening.DOTween.TotalPlayingTweens">
|
<member name="M:DG.Tweening.DOTween.TotalPlayingTweens">
|
||||||
<summary>
|
<summary>
|
||||||
|
|||||||
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.
@ -693,14 +693,17 @@
|
|||||||
<summary>Toggles the play state of all tweens with the given ID or target and returns the number of actual tweens toggled
|
<summary>Toggles the play state of all tweens with the given ID or target and returns the number of actual tweens toggled
|
||||||
(meaning the tweens that could be played or paused, depending on the toggle state)</summary>
|
(meaning the tweens that could be played or paused, depending on the toggle state)</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:DG.Tweening.DOTween.IsTweening(System.Object)">
|
<member name="M:DG.Tweening.DOTween.IsTweening(System.Object,System.Boolean)">
|
||||||
<summary>
|
<summary>
|
||||||
Returns TRUE if a tween with the given ID or target is active (regardless if it's playing or not).
|
Returns TRUE if a tween with the given ID or target is active.
|
||||||
<para>You can also use this to know if a shortcut tween is active for a given target.</para>
|
<para>You can also use this to know if a shortcut tween is active for a given target.</para>
|
||||||
<para>Example:</para>
|
<para>Example:</para>
|
||||||
<para><code>transform.DOMoveX(45, 1); // transform is automatically added as the tween target</code></para>
|
<para><code>transform.DOMoveX(45, 1); // transform is automatically added as the tween target</code></para>
|
||||||
<para><code>DOTween.IsTweening(transform); // Returns true</code></para>
|
<para><code>DOTween.IsTweening(transform); // Returns true</code></para>
|
||||||
</summary>
|
</summary>
|
||||||
|
<param name="targetOrId">The target or ID to look for</param>
|
||||||
|
<param name="alsoCheckIfIsPlaying">If FALSE (default) returns TRUE as long as a tween for the given target/ID is active,
|
||||||
|
otherwise also requires it to be playing</param>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:DG.Tweening.DOTween.TotalPlayingTweens">
|
<member name="M:DG.Tweening.DOTween.TotalPlayingTweens">
|
||||||
<summary>
|
<summary>
|
||||||
|
|||||||
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.
@ -693,14 +693,17 @@
|
|||||||
<summary>Toggles the play state of all tweens with the given ID or target and returns the number of actual tweens toggled
|
<summary>Toggles the play state of all tweens with the given ID or target and returns the number of actual tweens toggled
|
||||||
(meaning the tweens that could be played or paused, depending on the toggle state)</summary>
|
(meaning the tweens that could be played or paused, depending on the toggle state)</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:DG.Tweening.DOTween.IsTweening(System.Object)">
|
<member name="M:DG.Tweening.DOTween.IsTweening(System.Object,System.Boolean)">
|
||||||
<summary>
|
<summary>
|
||||||
Returns TRUE if a tween with the given ID or target is active (regardless if it's playing or not).
|
Returns TRUE if a tween with the given ID or target is active.
|
||||||
<para>You can also use this to know if a shortcut tween is active for a given target.</para>
|
<para>You can also use this to know if a shortcut tween is active for a given target.</para>
|
||||||
<para>Example:</para>
|
<para>Example:</para>
|
||||||
<para><code>transform.DOMoveX(45, 1); // transform is automatically added as the tween target</code></para>
|
<para><code>transform.DOMoveX(45, 1); // transform is automatically added as the tween target</code></para>
|
||||||
<para><code>DOTween.IsTweening(transform); // Returns true</code></para>
|
<para><code>DOTween.IsTweening(transform); // Returns true</code></para>
|
||||||
</summary>
|
</summary>
|
||||||
|
<param name="targetOrId">The target or ID to look for</param>
|
||||||
|
<param name="alsoCheckIfIsPlaying">If FALSE (default) returns TRUE as long as a tween for the given target/ID is active,
|
||||||
|
otherwise also requires it to be playing</param>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:DG.Tweening.DOTween.TotalPlayingTweens">
|
<member name="M:DG.Tweening.DOTween.TotalPlayingTweens">
|
||||||
<summary>
|
<summary>
|
||||||
|
|||||||
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.
@ -11,34 +11,26 @@ using UnityEngine.UI;
|
|||||||
|
|
||||||
public class TempTests : BrainBase
|
public class TempTests : BrainBase
|
||||||
{
|
{
|
||||||
private int killCounter = 0;
|
public Transform target;
|
||||||
|
|
||||||
private void Awake()
|
Sequence sequence;
|
||||||
|
|
||||||
|
void Start()
|
||||||
{
|
{
|
||||||
DOTween.Init(true, true, LogBehaviour.Verbose);
|
sequence = DOTween.Sequence();
|
||||||
DOTween.SetTweensCapacity(200, 125);
|
sequence.Append(target.DORotate(new Vector3(0,45f,0), 1f).SetEase(Ease.InOutCubic));
|
||||||
|
sequence.AppendInterval(2f);
|
||||||
|
sequence.SetLoops(-1, LoopType.Incremental);
|
||||||
|
sequence.SetRelative(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Start()
|
public void Pause()
|
||||||
{
|
{
|
||||||
const float Delay = 2;
|
sequence.Pause();
|
||||||
DOTween.Sequence().AppendInterval(Delay).OnKill(OnKill);
|
|
||||||
DOTween.Sequence().AppendInterval(Delay).OnKill(OnKill);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnKill()
|
public void Kil()
|
||||||
{
|
{
|
||||||
if (++killCounter == 2)
|
sequence.Kill();
|
||||||
StartCoroutine(Coroutine());
|
|
||||||
}
|
|
||||||
|
|
||||||
private IEnumerator Coroutine()
|
|
||||||
{
|
|
||||||
Sequence sequence = DOTween.Sequence().AppendInterval(2).OnKill(() => { });
|
|
||||||
|
|
||||||
yield return new WaitForSeconds(1);
|
|
||||||
|
|
||||||
Debug.Log("sequence.Kill()");
|
|
||||||
sequence.Kill(); // IndexOutOfRangeException
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Binary file not shown.
@ -507,7 +507,7 @@ namespace DG.Tweening.Core
|
|||||||
if (TogglePause(t)) totInvolved++;
|
if (TogglePause(t)) totInvolved++;
|
||||||
break;
|
break;
|
||||||
case OperationType.IsTweening:
|
case OperationType.IsTweening:
|
||||||
if (!t.isComplete || !t.autoKill) totInvolved++;
|
if ((!t.isComplete || !t.autoKill) && (!optionalBool || t.isPlaying)) totInvolved++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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.1.500";
|
public static readonly string Version = "1.1.510";
|
||||||
|
|
||||||
///////////////////////////////////////////////
|
///////////////////////////////////////////////
|
||||||
// Options ////////////////////////////////////
|
// Options ////////////////////////////////////
|
||||||
@ -875,15 +875,18 @@ namespace DG.Tweening
|
|||||||
#region Global Info Getters
|
#region Global Info Getters
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns TRUE if a tween with the given ID or target is active (regardless if it's playing or not).
|
/// Returns TRUE if a tween with the given ID or target is active.
|
||||||
/// <para>You can also use this to know if a shortcut tween is active for a given target.</para>
|
/// <para>You can also use this to know if a shortcut tween is active for a given target.</para>
|
||||||
/// <para>Example:</para>
|
/// <para>Example:</para>
|
||||||
/// <para><code>transform.DOMoveX(45, 1); // transform is automatically added as the tween target</code></para>
|
/// <para><code>transform.DOMoveX(45, 1); // transform is automatically added as the tween target</code></para>
|
||||||
/// <para><code>DOTween.IsTweening(transform); // Returns true</code></para>
|
/// <para><code>DOTween.IsTweening(transform); // Returns true</code></para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool IsTweening(object targetOrId)
|
/// <param name="targetOrId">The target or ID to look for</param>
|
||||||
|
/// <param name="alsoCheckIfIsPlaying">If FALSE (default) returns TRUE as long as a tween for the given target/ID is active,
|
||||||
|
/// otherwise also requires it to be playing</param>
|
||||||
|
public static bool IsTweening(object targetOrId, bool alsoCheckIfIsPlaying = false)
|
||||||
{
|
{
|
||||||
return TweenManager.FilteredOperation(OperationType.IsTweening, FilterType.TargetOrId, targetOrId, false, 0) > 0;
|
return TweenManager.FilteredOperation(OperationType.IsTweening, FilterType.TargetOrId, targetOrId, alsoCheckIfIsPlaying, 0) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -693,14 +693,17 @@
|
|||||||
<summary>Toggles the play state of all tweens with the given ID or target and returns the number of actual tweens toggled
|
<summary>Toggles the play state of all tweens with the given ID or target and returns the number of actual tweens toggled
|
||||||
(meaning the tweens that could be played or paused, depending on the toggle state)</summary>
|
(meaning the tweens that could be played or paused, depending on the toggle state)</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:DG.Tweening.DOTween.IsTweening(System.Object)">
|
<member name="M:DG.Tweening.DOTween.IsTweening(System.Object,System.Boolean)">
|
||||||
<summary>
|
<summary>
|
||||||
Returns TRUE if a tween with the given ID or target is active (regardless if it's playing or not).
|
Returns TRUE if a tween with the given ID or target is active.
|
||||||
<para>You can also use this to know if a shortcut tween is active for a given target.</para>
|
<para>You can also use this to know if a shortcut tween is active for a given target.</para>
|
||||||
<para>Example:</para>
|
<para>Example:</para>
|
||||||
<para><code>transform.DOMoveX(45, 1); // transform is automatically added as the tween target</code></para>
|
<para><code>transform.DOMoveX(45, 1); // transform is automatically added as the tween target</code></para>
|
||||||
<para><code>DOTween.IsTweening(transform); // Returns true</code></para>
|
<para><code>DOTween.IsTweening(transform); // Returns true</code></para>
|
||||||
</summary>
|
</summary>
|
||||||
|
<param name="targetOrId">The target or ID to look for</param>
|
||||||
|
<param name="alsoCheckIfIsPlaying">If FALSE (default) returns TRUE as long as a tween for the given target/ID is active,
|
||||||
|
otherwise also requires it to be playing</param>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:DG.Tweening.DOTween.TotalPlayingTweens">
|
<member name="M:DG.Tweening.DOTween.TotalPlayingTweens">
|
||||||
<summary>
|
<summary>
|
||||||
|
|||||||
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