1
0
mirror of https://github.com/Cardidi/dotween-upm-fork.git synced 2025-12-20 01:06:02 +08:00

[bugfix] Slightly modified and implemented Andrey Timofeev's fix for new IndexOutOfRangeException

This commit is contained in:
Demigiant 2016-10-26 13:17:08 +02:00
parent 85b2efd056
commit 1b2b216948
52 changed files with 39 additions and 13 deletions

View File

@ -356,6 +356,7 @@
<summary>
Checks all active tweens to find and remove eventually invalid ones (usually because their targets became NULL)
and returns the total number of invalid tweens found and removed.
IMPORTANT: this will cause an error on UWP platform, so don't use it there
BEWARE: this is a slightly expensive operation so use it with care
</summary>
</member>

View File

@ -356,6 +356,7 @@
<summary>
Checks all active tweens to find and remove eventually invalid ones (usually because their targets became NULL)
and returns the total number of invalid tweens found and removed.
IMPORTANT: this will cause an error on UWP platform, so don't use it there
BEWARE: this is a slightly expensive operation so use it with care
</summary>
</member>

View File

@ -356,6 +356,7 @@
<summary>
Checks all active tweens to find and remove eventually invalid ones (usually because their targets became NULL)
and returns the total number of invalid tweens found and removed.
IMPORTANT: this will cause an error on UWP platform, so don't use it there
BEWARE: this is a slightly expensive operation so use it with care
</summary>
</member>

View File

@ -11,8 +11,34 @@ using UnityEngine.UI;
public class TempTests : BrainBase
{
public void OnComplete()
private int killCounter = 0;
private void Awake()
{
Debug.Log("ON COMPLETE");
DOTween.Init(true, true, LogBehaviour.Verbose);
DOTween.SetTweensCapacity(200, 125);
}
private void Start()
{
const float Delay = 2;
DOTween.Sequence().AppendInterval(Delay).OnKill(OnKill);
DOTween.Sequence().AppendInterval(Delay).OnKill(OnKill);
}
private void OnKill()
{
if (++killCounter == 2)
StartCoroutine(Coroutine());
}
private IEnumerator Coroutine()
{
Sequence sequence = DOTween.Sequence().AppendInterval(2).OnKill(() => { });
yield return new WaitForSeconds(1);
Debug.Log("sequence.Kill()");
sequence.Kill(); // IndexOutOfRangeException
}
}

View File

@ -1,2 +1,2 @@
m_EditorVersion: 5.4.0f3
m_EditorVersion: 5.4.1f1
m_StandardAssetsVersion: 0

View File

@ -319,9 +319,7 @@ namespace DG.Tweening.Core
}
// Kill all eventually marked tweens
if (totInvalid > 0) {
DespawnTweens(_KillList, false);
int count = _KillList.Count - 1;
for (int i = count; i > -1; --i) RemoveActiveTween(_KillList[i]);
DespawnActiveTweens(_KillList);
_KillList.Clear();
}
return totInvalid;
@ -413,9 +411,7 @@ namespace DG.Tweening.Core
// Do not despawn tweens again, since Kill/DespawnAll was already called
_despawnAllCalledFromUpdateLoopCallback = false;
} else {
DespawnTweens(_KillList, false);
int count = _KillList.Count - 1;
for (int i = count; i > -1; --i) RemoveActiveTween(_KillList[i]);
DespawnActiveTweens(_KillList);
}
_KillList.Clear();
}
@ -833,10 +829,10 @@ namespace DG.Tweening.Core
_reorganizeFromId = -1;
}
static void DespawnTweens(List<Tween> tweens, bool modifyActiveLists = true)
static void DespawnActiveTweens(List<Tween> tweens)
{
int count = tweens.Count;
for (int i = 0; i < count; ++i) Despawn(tweens[i], modifyActiveLists);
int count = tweens.Count - 1;
for (int i = count; i > -1; --i) Despawn(tweens[i]);
}
// Removes a tween from the active list, reorganizes said list

View File

@ -32,7 +32,7 @@ namespace DG.Tweening
public class DOTween
{
/// <summary>DOTween's version</summary>
public static readonly string Version = "1.1.330";
public static readonly string Version = "1.1.340";
///////////////////////////////////////////////
// Options ////////////////////////////////////

View File

@ -356,6 +356,7 @@
<summary>
Checks all active tweens to find and remove eventually invalid ones (usually because their targets became NULL)
and returns the total number of invalid tweens found and removed.
IMPORTANT: this will cause an error on UWP platform, so don't use it there
BEWARE: this is a slightly expensive operation so use it with care
</summary>
</member>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.