Skip to content

Commit

Permalink
Fixed a bug in last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoguzhu committed May 23, 2018
1 parent 2cb600f commit 5784cbd
Showing 1 changed file with 12 additions and 25 deletions.
37 changes: 12 additions & 25 deletions Source/Scripts/UI/Transition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 5784cbd

Please sign in to comment.