Ejemplo n.º 1
0
        // 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;
        }
Ejemplo n.º 2
0
        public void Start()
        {
            Application.targetFrameRate = FPS;
            InteractionHandler.InitializeCamera();

            agents        = new List <Agent>();
            maxpopulation = 0;
            Playing       = true;
        }
Ejemplo n.º 3
0
 public void OnGUI()
 {
     InteractionHandler.OnGUI();
 }