1
0
mirror of https://github.com/Cardidi/dotween-upm-fork.git synced 2025-12-21 01:36:05 +08:00

FillableList passed to public Get methods is now cleared before being filled

This commit is contained in:
Demigiant 2017-11-08 12:05:59 +01:00
parent b4e9eb9075
commit 243571f908
48 changed files with 41 additions and 26 deletions

View File

@ -740,7 +740,7 @@
Returns NULL if there are no active playing tweens. Returns NULL if there are no active playing tweens.
<para>Beware: each time you call this method a new list is generated, so use it for debug only</para> <para>Beware: each time you call this method a new list is generated, so use it for debug only</para>
</summary> </summary>
<param name="fillableList">If NULL creates a new list, otherwise fills this one (and thus saves allocations)</param> <param name="fillableList">If NULL creates a new list, otherwise clears and fills this one (and thus saves allocations)</param>
</member> </member>
<member name="M:DG.Tweening.DOTween.PausedTweens(System.Collections.Generic.List{DG.Tweening.Tween})"> <member name="M:DG.Tweening.DOTween.PausedTweens(System.Collections.Generic.List{DG.Tweening.Tween})">
<summary> <summary>
@ -748,7 +748,7 @@
Returns NULL if there are no active paused tweens. Returns NULL if there are no active paused tweens.
<para>Beware: each time you call this method a new list is generated, so use it for debug only</para> <para>Beware: each time you call this method a new list is generated, so use it for debug only</para>
</summary> </summary>
<param name="fillableList">If NULL creates a new list, otherwise fills this one (and thus saves allocations)</param> <param name="fillableList">If NULL creates a new list, otherwise clears and fills this one (and thus saves allocations)</param>
</member> </member>
<member name="M:DG.Tweening.DOTween.TweensById(System.Object,System.Boolean,System.Collections.Generic.List{DG.Tweening.Tween})"> <member name="M:DG.Tweening.DOTween.TweensById(System.Object,System.Boolean,System.Collections.Generic.List{DG.Tweening.Tween})">
<summary> <summary>
@ -757,7 +757,7 @@
<para>Beware: each time you call this method a new list is generated</para> <para>Beware: each time you call this method a new list is generated</para>
</summary> </summary>
<param name="playingOnly">If TRUE returns only the tweens with the given ID that are currently playing</param> <param name="playingOnly">If TRUE returns only the tweens with the given ID that are currently playing</param>
<param name="fillableList">If NULL creates a new list, otherwise fills this one (and thus saves allocations)</param> <param name="fillableList">If NULL creates a new list, otherwise clears and fills this one (and thus saves allocations)</param>
</member> </member>
<member name="M:DG.Tweening.DOTween.TweensByTarget(System.Object,System.Boolean,System.Collections.Generic.List{DG.Tweening.Tween})"> <member name="M:DG.Tweening.DOTween.TweensByTarget(System.Object,System.Boolean,System.Collections.Generic.List{DG.Tweening.Tween})">
<summary> <summary>
@ -765,7 +765,7 @@
Returns NULL if there are no active tweens with the given target. Returns NULL if there are no active tweens with the given target.
<para>Beware: each time you call this method a new list is generated</para> <para>Beware: each time you call this method a new list is generated</para>
<param name="playingOnly">If TRUE returns only the tweens with the given target that are currently playing</param> <param name="playingOnly">If TRUE returns only the tweens with the given target that are currently playing</param>
<param name="fillableList">If NULL creates a new list, otherwise fills this one (and thus saves allocations)</param> <param name="fillableList">If NULL creates a new list, otherwise clears and fills this one (and thus saves allocations)</param>
</summary> </summary>
</member> </member>
<member name="T:DG.Tweening.DOVirtual"> <member name="T:DG.Tweening.DOVirtual">

View File

@ -740,7 +740,7 @@
Returns NULL if there are no active playing tweens. Returns NULL if there are no active playing tweens.
<para>Beware: each time you call this method a new list is generated, so use it for debug only</para> <para>Beware: each time you call this method a new list is generated, so use it for debug only</para>
</summary> </summary>
<param name="fillableList">If NULL creates a new list, otherwise fills this one (and thus saves allocations)</param> <param name="fillableList">If NULL creates a new list, otherwise clears and fills this one (and thus saves allocations)</param>
</member> </member>
<member name="M:DG.Tweening.DOTween.PausedTweens(System.Collections.Generic.List{DG.Tweening.Tween})"> <member name="M:DG.Tweening.DOTween.PausedTweens(System.Collections.Generic.List{DG.Tweening.Tween})">
<summary> <summary>
@ -748,7 +748,7 @@
Returns NULL if there are no active paused tweens. Returns NULL if there are no active paused tweens.
<para>Beware: each time you call this method a new list is generated, so use it for debug only</para> <para>Beware: each time you call this method a new list is generated, so use it for debug only</para>
</summary> </summary>
<param name="fillableList">If NULL creates a new list, otherwise fills this one (and thus saves allocations)</param> <param name="fillableList">If NULL creates a new list, otherwise clears and fills this one (and thus saves allocations)</param>
</member> </member>
<member name="M:DG.Tweening.DOTween.TweensById(System.Object,System.Boolean,System.Collections.Generic.List{DG.Tweening.Tween})"> <member name="M:DG.Tweening.DOTween.TweensById(System.Object,System.Boolean,System.Collections.Generic.List{DG.Tweening.Tween})">
<summary> <summary>
@ -757,7 +757,7 @@
<para>Beware: each time you call this method a new list is generated</para> <para>Beware: each time you call this method a new list is generated</para>
</summary> </summary>
<param name="playingOnly">If TRUE returns only the tweens with the given ID that are currently playing</param> <param name="playingOnly">If TRUE returns only the tweens with the given ID that are currently playing</param>
<param name="fillableList">If NULL creates a new list, otherwise fills this one (and thus saves allocations)</param> <param name="fillableList">If NULL creates a new list, otherwise clears and fills this one (and thus saves allocations)</param>
</member> </member>
<member name="M:DG.Tweening.DOTween.TweensByTarget(System.Object,System.Boolean,System.Collections.Generic.List{DG.Tweening.Tween})"> <member name="M:DG.Tweening.DOTween.TweensByTarget(System.Object,System.Boolean,System.Collections.Generic.List{DG.Tweening.Tween})">
<summary> <summary>
@ -765,7 +765,7 @@
Returns NULL if there are no active tweens with the given target. Returns NULL if there are no active tweens with the given target.
<para>Beware: each time you call this method a new list is generated</para> <para>Beware: each time you call this method a new list is generated</para>
<param name="playingOnly">If TRUE returns only the tweens with the given target that are currently playing</param> <param name="playingOnly">If TRUE returns only the tweens with the given target that are currently playing</param>
<param name="fillableList">If NULL creates a new list, otherwise fills this one (and thus saves allocations)</param> <param name="fillableList">If NULL creates a new list, otherwise clears and fills this one (and thus saves allocations)</param>
</summary> </summary>
</member> </member>
<member name="T:DG.Tweening.DOVirtual"> <member name="T:DG.Tweening.DOVirtual">

View File

@ -15,6 +15,14 @@ namespace DG.Tweening
#region Public Methods #region Public Methods
#region Commands
#endregion
#region Info Getters
/// <summary> /// <summary>
/// Returns TRUE if there are tweens with the given id, and they're all currently playing forward /// Returns TRUE if there are tweens with the given id, and they're all currently playing forward
/// </summary> /// </summary>
@ -68,6 +76,8 @@ namespace DG.Tweening
#endregion #endregion
#endregion
#region Methods #region Methods
static bool AreAllPlayingForward(List<Tween> tweens) static bool AreAllPlayingForward(List<Tween> tweens)

View File

@ -740,7 +740,7 @@
Returns NULL if there are no active playing tweens. Returns NULL if there are no active playing tweens.
<para>Beware: each time you call this method a new list is generated, so use it for debug only</para> <para>Beware: each time you call this method a new list is generated, so use it for debug only</para>
</summary> </summary>
<param name="fillableList">If NULL creates a new list, otherwise fills this one (and thus saves allocations)</param> <param name="fillableList">If NULL creates a new list, otherwise clears and fills this one (and thus saves allocations)</param>
</member> </member>
<member name="M:DG.Tweening.DOTween.PausedTweens(System.Collections.Generic.List{DG.Tweening.Tween})"> <member name="M:DG.Tweening.DOTween.PausedTweens(System.Collections.Generic.List{DG.Tweening.Tween})">
<summary> <summary>
@ -748,7 +748,7 @@
Returns NULL if there are no active paused tweens. Returns NULL if there are no active paused tweens.
<para>Beware: each time you call this method a new list is generated, so use it for debug only</para> <para>Beware: each time you call this method a new list is generated, so use it for debug only</para>
</summary> </summary>
<param name="fillableList">If NULL creates a new list, otherwise fills this one (and thus saves allocations)</param> <param name="fillableList">If NULL creates a new list, otherwise clears and fills this one (and thus saves allocations)</param>
</member> </member>
<member name="M:DG.Tweening.DOTween.TweensById(System.Object,System.Boolean,System.Collections.Generic.List{DG.Tweening.Tween})"> <member name="M:DG.Tweening.DOTween.TweensById(System.Object,System.Boolean,System.Collections.Generic.List{DG.Tweening.Tween})">
<summary> <summary>
@ -757,7 +757,7 @@
<para>Beware: each time you call this method a new list is generated</para> <para>Beware: each time you call this method a new list is generated</para>
</summary> </summary>
<param name="playingOnly">If TRUE returns only the tweens with the given ID that are currently playing</param> <param name="playingOnly">If TRUE returns only the tweens with the given ID that are currently playing</param>
<param name="fillableList">If NULL creates a new list, otherwise fills this one (and thus saves allocations)</param> <param name="fillableList">If NULL creates a new list, otherwise clears and fills this one (and thus saves allocations)</param>
</member> </member>
<member name="M:DG.Tweening.DOTween.TweensByTarget(System.Object,System.Boolean,System.Collections.Generic.List{DG.Tweening.Tween})"> <member name="M:DG.Tweening.DOTween.TweensByTarget(System.Object,System.Boolean,System.Collections.Generic.List{DG.Tweening.Tween})">
<summary> <summary>
@ -765,7 +765,7 @@
Returns NULL if there are no active tweens with the given target. Returns NULL if there are no active tweens with the given target.
<para>Beware: each time you call this method a new list is generated</para> <para>Beware: each time you call this method a new list is generated</para>
<param name="playingOnly">If TRUE returns only the tweens with the given target that are currently playing</param> <param name="playingOnly">If TRUE returns only the tweens with the given target that are currently playing</param>
<param name="fillableList">If NULL creates a new list, otherwise fills this one (and thus saves allocations)</param> <param name="fillableList">If NULL creates a new list, otherwise clears and fills this one (and thus saves allocations)</param>
</summary> </summary>
</member> </member>
<member name="T:DG.Tweening.DOVirtual"> <member name="T:DG.Tweening.DOVirtual">

View File

@ -11,12 +11,13 @@ using UnityEngine.UI;
public class TempTests : BrainBase public class TempTests : BrainBase
{ {
public Rigidbody target; public Transform target;
public float duration = 1f;
void Start() IEnumerator Start()
{ {
target.transform.DOJump(new Vector3(2.5f, 1.5f, -4.5f), 2, 1, duration).SetDelay(1) yield return new WaitForSeconds(0.8f);
.OnComplete(()=> Debug.Log(target.position));
Tween t = target.DOShakeRotation(5f, new Vector3(0f, 20f, 20f), 4, 10f, true);
// Tween t = target.DOPunchRotation(new Vector3(0f, 0f, 20f), 5, 10);
} }
} }

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.1.665"; public static readonly string Version = "1.1.670";
/////////////////////////////////////////////// ///////////////////////////////////////////////
// Options //////////////////////////////////// // Options ////////////////////////////////////
@ -924,9 +924,10 @@ namespace DG.Tweening
/// Returns NULL if there are no active playing tweens. /// Returns NULL if there are no active playing tweens.
/// <para>Beware: each time you call this method a new list is generated, so use it for debug only</para> /// <para>Beware: each time you call this method a new list is generated, so use it for debug only</para>
/// </summary> /// </summary>
/// <param name="fillableList">If NULL creates a new list, otherwise fills this one (and thus saves allocations)</param> /// <param name="fillableList">If NULL creates a new list, otherwise clears and fills this one (and thus saves allocations)</param>
public static List<Tween> PlayingTweens(List<Tween> fillableList = null) public static List<Tween> PlayingTweens(List<Tween> fillableList = null)
{ {
if (fillableList != null) fillableList.Clear();
return TweenManager.GetActiveTweens(true, fillableList); return TweenManager.GetActiveTweens(true, fillableList);
} }
@ -935,9 +936,10 @@ namespace DG.Tweening
/// Returns NULL if there are no active paused tweens. /// Returns NULL if there are no active paused tweens.
/// <para>Beware: each time you call this method a new list is generated, so use it for debug only</para> /// <para>Beware: each time you call this method a new list is generated, so use it for debug only</para>
/// </summary> /// </summary>
/// <param name="fillableList">If NULL creates a new list, otherwise fills this one (and thus saves allocations)</param> /// <param name="fillableList">If NULL creates a new list, otherwise clears and fills this one (and thus saves allocations)</param>
public static List<Tween> PausedTweens(List<Tween> fillableList = null) public static List<Tween> PausedTweens(List<Tween> fillableList = null)
{ {
if (fillableList != null) fillableList.Clear();
return TweenManager.GetActiveTweens(false, fillableList); return TweenManager.GetActiveTweens(false, fillableList);
} }
@ -947,11 +949,12 @@ namespace DG.Tweening
/// <para>Beware: each time you call this method a new list is generated</para> /// <para>Beware: each time you call this method a new list is generated</para>
/// </summary> /// </summary>
/// <param name="playingOnly">If TRUE returns only the tweens with the given ID that are currently playing</param> /// <param name="playingOnly">If TRUE returns only the tweens with the given ID that are currently playing</param>
/// <param name="fillableList">If NULL creates a new list, otherwise fills this one (and thus saves allocations)</param> /// <param name="fillableList">If NULL creates a new list, otherwise clears and fills this one (and thus saves allocations)</param>
public static List<Tween> TweensById(object id, bool playingOnly = false, List<Tween> fillableList = null) public static List<Tween> TweensById(object id, bool playingOnly = false, List<Tween> fillableList = null)
{ {
if (id == null) return null; if (id == null) return null;
if (fillableList != null) fillableList.Clear();
return TweenManager.GetTweensById(id, playingOnly, fillableList); return TweenManager.GetTweensById(id, playingOnly, fillableList);
} }
@ -960,10 +963,11 @@ namespace DG.Tweening
/// Returns NULL if there are no active tweens with the given target. /// Returns NULL if there are no active tweens with the given target.
/// <para>Beware: each time you call this method a new list is generated</para> /// <para>Beware: each time you call this method a new list is generated</para>
/// <param name="playingOnly">If TRUE returns only the tweens with the given target that are currently playing</param> /// <param name="playingOnly">If TRUE returns only the tweens with the given target that are currently playing</param>
/// <param name="fillableList">If NULL creates a new list, otherwise fills this one (and thus saves allocations)</param> /// <param name="fillableList">If NULL creates a new list, otherwise clears and fills this one (and thus saves allocations)</param>
/// </summary> /// </summary>
public static List<Tween> TweensByTarget(object target, bool playingOnly = false, List<Tween> fillableList = null) public static List<Tween> TweensByTarget(object target, bool playingOnly = false, List<Tween> fillableList = null)
{ {
if (fillableList != null) fillableList.Clear();
return TweenManager.GetTweensByTarget(target, playingOnly, fillableList); return TweenManager.GetTweensByTarget(target, playingOnly, fillableList);
} }

View File

@ -740,7 +740,7 @@
Returns NULL if there are no active playing tweens. Returns NULL if there are no active playing tweens.
<para>Beware: each time you call this method a new list is generated, so use it for debug only</para> <para>Beware: each time you call this method a new list is generated, so use it for debug only</para>
</summary> </summary>
<param name="fillableList">If NULL creates a new list, otherwise fills this one (and thus saves allocations)</param> <param name="fillableList">If NULL creates a new list, otherwise clears and fills this one (and thus saves allocations)</param>
</member> </member>
<member name="M:DG.Tweening.DOTween.PausedTweens(System.Collections.Generic.List{DG.Tweening.Tween})"> <member name="M:DG.Tweening.DOTween.PausedTweens(System.Collections.Generic.List{DG.Tweening.Tween})">
<summary> <summary>
@ -748,7 +748,7 @@
Returns NULL if there are no active paused tweens. Returns NULL if there are no active paused tweens.
<para>Beware: each time you call this method a new list is generated, so use it for debug only</para> <para>Beware: each time you call this method a new list is generated, so use it for debug only</para>
</summary> </summary>
<param name="fillableList">If NULL creates a new list, otherwise fills this one (and thus saves allocations)</param> <param name="fillableList">If NULL creates a new list, otherwise clears and fills this one (and thus saves allocations)</param>
</member> </member>
<member name="M:DG.Tweening.DOTween.TweensById(System.Object,System.Boolean,System.Collections.Generic.List{DG.Tweening.Tween})"> <member name="M:DG.Tweening.DOTween.TweensById(System.Object,System.Boolean,System.Collections.Generic.List{DG.Tweening.Tween})">
<summary> <summary>
@ -757,7 +757,7 @@
<para>Beware: each time you call this method a new list is generated</para> <para>Beware: each time you call this method a new list is generated</para>
</summary> </summary>
<param name="playingOnly">If TRUE returns only the tweens with the given ID that are currently playing</param> <param name="playingOnly">If TRUE returns only the tweens with the given ID that are currently playing</param>
<param name="fillableList">If NULL creates a new list, otherwise fills this one (and thus saves allocations)</param> <param name="fillableList">If NULL creates a new list, otherwise clears and fills this one (and thus saves allocations)</param>
</member> </member>
<member name="M:DG.Tweening.DOTween.TweensByTarget(System.Object,System.Boolean,System.Collections.Generic.List{DG.Tweening.Tween})"> <member name="M:DG.Tweening.DOTween.TweensByTarget(System.Object,System.Boolean,System.Collections.Generic.List{DG.Tweening.Tween})">
<summary> <summary>
@ -765,7 +765,7 @@
Returns NULL if there are no active tweens with the given target. Returns NULL if there are no active tweens with the given target.
<para>Beware: each time you call this method a new list is generated</para> <para>Beware: each time you call this method a new list is generated</para>
<param name="playingOnly">If TRUE returns only the tweens with the given target that are currently playing</param> <param name="playingOnly">If TRUE returns only the tweens with the given target that are currently playing</param>
<param name="fillableList">If NULL creates a new list, otherwise fills this one (and thus saves allocations)</param> <param name="fillableList">If NULL creates a new list, otherwise clears and fills this one (and thus saves allocations)</param>
</summary> </summary>
</member> </member>
<member name="T:DG.Tweening.DOVirtual"> <member name="T:DG.Tweening.DOVirtual">

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.