diff --git a/Source/Scripts/UI/Transition.cs b/Source/Scripts/UI/Transition.cs index de3e45f8..29d83cf6 100644 --- a/Source/Scripts/UI/Transition.cs +++ b/Source/Scripts/UI/Transition.cs @@ -284,36 +284,23 @@ void StopItem(TransitionItem item, bool setToComplete) public void Dispose() { - if (_playing) + int cnt = _items.Count; + for (int i = 0; i < cnt; i++) { - int cnt = _items.Count; - for (int i = 0; i < cnt; i++) + TransitionItem item = _items[i]; + if (item.tweener != null) { - TransitionItem item = _items[i]; - if (item.target == null || item.completed) - continue; - - if (item.tweener != null) - { - item.tweener.Kill(); - item.tweener = null; - } - else if (item.type == TransitionActionType.Shake) - { - ((TransitionItem_Shake)item).Stop(false); - } + item.tweener.Kill(); + item.tweener = null; } - } - else - { - int cnt = _items.Count; - for (int i = 0; i < cnt; i++) + else if (_playing && item.type == TransitionActionType.Shake) { - TransitionItem item = _items[i]; - item.target = null; - item.hook = null; - item.hook2 = null; + ((TransitionItem_Shake)item).Stop(false); } + + item.target = null; + item.hook = null; + item.hook2 = null; } _items.Clear();