// Updates everything to the next frame! public void Update() { InteractionHandler.Update(); grid.DebugDraw(); if (Playing) { grid.Update(); agents.ForEach(a => a.Update()); if (agents.Count < maxpopulation) { AddAgent(); } else if (agents.Count > maxpopulation) { Agent a = agents.FirstOrDefault(); if (a != null) { a.Unspawn(); } } } // Uncommenting this will pause the simulation after every frame //Playing = false; }
public void Start() { Application.targetFrameRate = FPS; InteractionHandler.InitializeCamera(); agents = new List <Agent>(); maxpopulation = 0; Playing = true; }
public void OnGUI() { InteractionHandler.OnGUI(); }