mirror of
https://github.com/Cardidi/dotween-upm-fork.git
synced 2025-12-20 17:26:03 +08:00
Added DOTween.Play/Restart overloads to filter by tweens with BOTH the given target AND id
This commit is contained in:
parent
50d0a6c790
commit
85229fb5bf
@ -1669,6 +1669,10 @@
|
||||
<summary>Plays all tweens with the given ID or target and returns the number of actual tweens played
|
||||
(meaning the tweens that were not already playing or complete)</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.DOTween.Play(System.Object,System.Object)">
|
||||
<summary>Plays all tweens with the given target and the given ID, and returns the number of actual tweens played
|
||||
(meaning the tweens that were not already playing or complete)</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.DOTween.PlayBackwardsAll">
|
||||
<summary>Plays backwards all tweens and returns the number of actual tweens played
|
||||
(meaning tweens that were not already started, playing backwards or rewinded)</summary>
|
||||
@ -1691,6 +1695,10 @@
|
||||
<member name="M:DG.Tweening.DOTween.Restart(System.Object,System.Boolean)">
|
||||
<summary>Restarts all tweens with the given ID or target, then returns the number of actual tweens restarted</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.DOTween.Restart(System.Object,System.Object,System.Boolean)">
|
||||
<summary>Restarts all tweens with the given target and the given ID, and returns the number of actual tweens played
|
||||
(meaning the tweens that were not already playing or complete)</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.DOTween.RewindAll(System.Boolean)">
|
||||
<summary>Rewinds and pauses all tweens, then returns the number of actual tweens rewinded
|
||||
(meaning tweens that were not already rewinded)</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.
@ -1669,6 +1669,10 @@
|
||||
<summary>Plays all tweens with the given ID or target and returns the number of actual tweens played
|
||||
(meaning the tweens that were not already playing or complete)</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.DOTween.Play(System.Object,System.Object)">
|
||||
<summary>Plays all tweens with the given target and the given ID, and returns the number of actual tweens played
|
||||
(meaning the tweens that were not already playing or complete)</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.DOTween.PlayBackwardsAll">
|
||||
<summary>Plays backwards all tweens and returns the number of actual tweens played
|
||||
(meaning tweens that were not already started, playing backwards or rewinded)</summary>
|
||||
@ -1691,6 +1695,10 @@
|
||||
<member name="M:DG.Tweening.DOTween.Restart(System.Object,System.Boolean)">
|
||||
<summary>Restarts all tweens with the given ID or target, then returns the number of actual tweens restarted</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.DOTween.Restart(System.Object,System.Object,System.Boolean)">
|
||||
<summary>Restarts all tweens with the given target and the given ID, and returns the number of actual tweens played
|
||||
(meaning the tweens that were not already playing or complete)</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.DOTween.RewindAll(System.Boolean)">
|
||||
<summary>Rewinds and pauses all tweens, then returns the number of actual tweens rewinded
|
||||
(meaning tweens that were not already rewinded)</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.
@ -1669,6 +1669,10 @@
|
||||
<summary>Plays all tweens with the given ID or target and returns the number of actual tweens played
|
||||
(meaning the tweens that were not already playing or complete)</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.DOTween.Play(System.Object,System.Object)">
|
||||
<summary>Plays all tweens with the given target and the given ID, and returns the number of actual tweens played
|
||||
(meaning the tweens that were not already playing or complete)</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.DOTween.PlayBackwardsAll">
|
||||
<summary>Plays backwards all tweens and returns the number of actual tweens played
|
||||
(meaning tweens that were not already started, playing backwards or rewinded)</summary>
|
||||
@ -1691,6 +1695,10 @@
|
||||
<member name="M:DG.Tweening.DOTween.Restart(System.Object,System.Boolean)">
|
||||
<summary>Restarts all tweens with the given ID or target, then returns the number of actual tweens restarted</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.DOTween.Restart(System.Object,System.Object,System.Boolean)">
|
||||
<summary>Restarts all tweens with the given target and the given ID, and returns the number of actual tweens played
|
||||
(meaning the tweens that were not already playing or complete)</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.DOTween.RewindAll(System.Boolean)">
|
||||
<summary>Rewinds and pauses all tweens, then returns the number of actual tweens rewinded
|
||||
(meaning tweens that were not already rewinded)</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.
BIN
UnityTests.Unity5/Assets/_Examples/DOTweenAnimation.unity
Normal file
BIN
UnityTests.Unity5/Assets/_Examples/DOTweenAnimation.unity
Normal file
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1ece7130f3f26bf4daeec58ebae1ba14
|
||||
timeCreated: 1428256196
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@ -10,6 +10,7 @@ namespace DG.Tweening.Core.Enums
|
||||
{
|
||||
All,
|
||||
TargetOrId, // Check both for id and target
|
||||
TargetAndId, // Check for both id and target on the same tween
|
||||
DOGetter
|
||||
}
|
||||
}
|
||||
@ -403,7 +403,7 @@ namespace DG.Tweening.Core
|
||||
isUpdateLoop = false;
|
||||
}
|
||||
|
||||
internal static int FilteredOperation(OperationType operationType, FilterType filterType, object id, bool optionalBool, float optionalFloat)
|
||||
internal static int FilteredOperation(OperationType operationType, FilterType filterType, object id, bool optionalBool, float optionalFloat, object optionalObj = null)
|
||||
{
|
||||
int totInvolved = 0;
|
||||
bool hasDespawned = false;
|
||||
@ -419,6 +419,9 @@ namespace DG.Tweening.Core
|
||||
case FilterType.TargetOrId:
|
||||
isFilterCompliant = id.Equals(t.id) || id.Equals(t.target);
|
||||
break;
|
||||
case FilterType.TargetAndId:
|
||||
isFilterCompliant = id.Equals(t.id) && optionalObj != null && optionalObj.Equals(t.target);
|
||||
break;
|
||||
}
|
||||
if (isFilterCompliant) {
|
||||
switch (operationType) {
|
||||
|
||||
@ -21,7 +21,7 @@ namespace DG.Tweening
|
||||
public class DOTween
|
||||
{
|
||||
/// <summary>DOTween's version</summary>
|
||||
public static readonly string Version = "1.0.432";
|
||||
public static readonly string Version = "1.0.435";
|
||||
|
||||
///////////////////////////////////////////////
|
||||
// Options ////////////////////////////////////
|
||||
@ -698,6 +698,13 @@ namespace DG.Tweening
|
||||
if (targetOrId == null) return 0;
|
||||
return TweenManager.FilteredOperation(OperationType.Play, FilterType.TargetOrId, targetOrId, false, 0);
|
||||
}
|
||||
/// <summary>Plays all tweens with the given target and the given ID, and returns the number of actual tweens played
|
||||
/// (meaning the tweens that were not already playing or complete)</summary>
|
||||
public static int Play(object target, object id)
|
||||
{
|
||||
if (target == null || id == null) return 0;
|
||||
return TweenManager.FilteredOperation(OperationType.Play, FilterType.TargetAndId, id, false, 0, target);
|
||||
}
|
||||
|
||||
/// <summary>Plays backwards all tweens and returns the number of actual tweens played
|
||||
/// (meaning tweens that were not already started, playing backwards or rewinded)</summary>
|
||||
@ -738,6 +745,13 @@ namespace DG.Tweening
|
||||
if (targetOrId == null) return 0;
|
||||
return TweenManager.FilteredOperation(OperationType.Restart, FilterType.TargetOrId, targetOrId, includeDelay, 0);
|
||||
}
|
||||
/// <summary>Restarts all tweens with the given target and the given ID, and returns the number of actual tweens played
|
||||
/// (meaning the tweens that were not already playing or complete)</summary>
|
||||
public static int Restart(object target, object id, bool includeDelay = true)
|
||||
{
|
||||
if (target == null || id == null) return 0;
|
||||
return TweenManager.FilteredOperation(OperationType.Restart, FilterType.TargetAndId, id, includeDelay, 0, target);
|
||||
}
|
||||
|
||||
/// <summary>Rewinds and pauses all tweens, then returns the number of actual tweens rewinded
|
||||
/// (meaning tweens that were not already rewinded)</summary>
|
||||
|
||||
@ -1669,6 +1669,10 @@
|
||||
<summary>Plays all tweens with the given ID or target and returns the number of actual tweens played
|
||||
(meaning the tweens that were not already playing or complete)</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.DOTween.Play(System.Object,System.Object)">
|
||||
<summary>Plays all tweens with the given target and the given ID, and returns the number of actual tweens played
|
||||
(meaning the tweens that were not already playing or complete)</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.DOTween.PlayBackwardsAll">
|
||||
<summary>Plays backwards all tweens and returns the number of actual tweens played
|
||||
(meaning tweens that were not already started, playing backwards or rewinded)</summary>
|
||||
@ -1691,6 +1695,10 @@
|
||||
<member name="M:DG.Tweening.DOTween.Restart(System.Object,System.Boolean)">
|
||||
<summary>Restarts all tweens with the given ID or target, then returns the number of actual tweens restarted</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.DOTween.Restart(System.Object,System.Object,System.Boolean)">
|
||||
<summary>Restarts all tweens with the given target and the given ID, and returns the number of actual tweens played
|
||||
(meaning the tweens that were not already playing or complete)</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.DOTween.RewindAll(System.Boolean)">
|
||||
<summary>Rewinds and pauses all tweens, then returns the number of actual tweens rewinded
|
||||
(meaning tweens that were not already rewinded)</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.
Loading…
x
Reference in New Issue
Block a user