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)
|
public void Update(EngineTime time)
|
||||||
{
|
{
|
||||||
Time.SetTime(time);
|
Time.SetTime(time);
|
||||||
foreach (var gameObject in GameObjects)
|
for (int i = 0; i < GameObjects.Count; i++)
|
||||||
gameObject.BehaviourController.Update();
|
GameObjects[i].BehaviourController.Update();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PreDraw()
|
public void PreDraw()
|
||||||
{
|
{
|
||||||
foreach (var gameObject in GameObjects)
|
for (int i = 0; i < GameObjects.Count; i++)
|
||||||
gameObject.BehaviourController.UpdatePreDraw();
|
GameObjects[i].BehaviourController.UpdatePreDraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////
|
||||||
|
|
Loading…
Reference in New Issue