fix: GameManager Instantiation/Deletion during Update causing Array Changed Exception
This commit is contained in:
parent
0f8a7db567
commit
c51eda49bf
|
@ -89,14 +89,14 @@ public class GameManager : BaseEntity, IGameManager
|
|||
public void Update(EngineTime time)
|
||||
{
|
||||
Time.SetTime(time);
|
||||
foreach (var gameObject in GameObjects)
|
||||
gameObject.BehaviourController.Update();
|
||||
for (int i = 0; i < GameObjects.Count; i++)
|
||||
GameObjects[i].BehaviourController.Update();
|
||||
}
|
||||
|
||||
public void PreDraw()
|
||||
{
|
||||
foreach (var gameObject in GameObjects)
|
||||
gameObject.BehaviourController.UpdatePreDraw();
|
||||
for (int i = 0; i < GameObjects.Count; i++)
|
||||
GameObjects[i].BehaviourController.UpdatePreDraw();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Reference in New Issue