Skip to content

Commit 9c4e74d

Browse files
author
Hyunwook Ha
committed
fix for AudioController.Update() at 2d game tutorial.
1 parent 580a73a commit 9c4e74d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

articles/tutorials/building_2d_games/15_audio_controller/snippets/audiocontroller.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ public void Update()
119119
if (instance.State == SoundState.Stopped && !instance.IsDisposed)
120120
{
121121
instance.Dispose();
122+
_activeSoundEffectInstances.RemoveAt(index);
122123
}
123-
124-
_activeSoundEffectInstances.RemoveAt(index);
124+
index++;
125125
}
126126
}
127127
#endregion

0 commit comments

Comments
 (0)