diff --git a/Assets/LeanTween/Framework/LeanTween.cs b/Assets/LeanTween/Framework/LeanTween.cs index 8bc23e41..17a2062b 100755 --- a/Assets/LeanTween/Framework/LeanTween.cs +++ b/Assets/LeanTween/Framework/LeanTween.cs @@ -627,17 +627,19 @@ public static void cancel( int uniqueId, bool callOnComplete ){ if (backId > tweens.Length - 1) { // sequence int sequenceId = backId - tweens.Length; LTSeq seq = sequences[sequenceId]; - // Debug.Log("sequenceId:" + sequenceId+" maxSequences:"+maxSequences+" prev:"+seq.previous); - - for (int i = 0; i < maxSequences; i++) { - if (seq.current.tween != null) { - int tweenId = seq.current.tween.uniqueId; - int tweenIndex = tweenId & 0xFFFF; - removeTween(tweenIndex); + if (seq.counter == backCounter) { + // Debug.Log("sequenceId:" + sequenceId+" maxSequences:"+maxSequences+" prev:"+seq.previous); + + for (int i = 0; i < maxSequences; i++) { + if (seq.current.tween != null) { + int tweenId = seq.current.tween.uniqueId; + int tweenIndex = tweenId & 0xFFFF; + removeTween(tweenIndex); + } + if (seq.current.previous == null) + break; + seq.current = seq.current.previous; } - if (seq.current.previous == null) - break; - seq.current = seq.current.previous; } } else { // tween // Debug.Log("uniqueId:"+uniqueId+ " id:"+backId +" action:"+(TweenAction)backType + " tweens[id].type:"+tweens[backId].type);