1
0
mirror of https://github.com/Cardidi/dotween-upm-fork.git synced 2026-02-04 14:24:55 +08:00

[bugfix] Fixed IndexOutOfRange error in case a Kill was called from within a Kill operation

This commit is contained in:
Demigiant 2017-02-20 11:21:59 +01:00
parent a3c95d9fc9
commit 9d3a003de4
46 changed files with 49 additions and 7 deletions

View File

@ -0,0 +1,22 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;
public class IndexOutOfRangeOnKill : BrainBase
{
IEnumerator Start()
{
transform.DOScale(Vector3.zero, 1000).OnKill(() => transform.gameObject.SetActive(false));
yield return new WaitForSeconds(1.5f);
transform.DOKill();
Debug.Log("START COMPLETION");
}
void OnDisable()
{
Debug.Log("DISABLE");
transform.DOKill();
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 8554fbc54189c474d984b52a42025763
timeCreated: 1487584236
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a571c26de03502e448b5fd36db17cc82
timeCreated: 1487584203
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -468,12 +468,12 @@ namespace DG.Tweening.Core
switch (operationType) { switch (operationType) {
case OperationType.Despawn: case OperationType.Despawn:
totInvolved++; totInvolved++;
if (isUpdateLoop) t.active = false; // Just mark it for killing, so the update loop will take care of it t.active = false; // Mark it as inactive immediately, so eventual kills called inside a kill won't have effect
else { // if (isUpdateLoop) t.active = false; // Just mark it for killing, so the update loop will take care of it
Despawn(t, false); if (isUpdateLoop) break; // Just mark it for killing, the update loop will take care of the rest
hasDespawned = true; Despawn(t, false);
_KillList.Add(t); hasDespawned = true;
} _KillList.Add(t);
break; break;
case OperationType.Complete: case OperationType.Complete:
bool hasAutoKill = t.autoKill; bool hasAutoKill = t.autoKill;

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.570"; public static readonly string Version = "1.1.575";
/////////////////////////////////////////////// ///////////////////////////////////////////////
// Options //////////////////////////////////// // Options ////////////////////////////////////

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.