public void Load() { var agents = new AgentBase[] { new RedCarAgent(), new BlueCarAgent(), new GreenCarAgent() }; var startingTiles = TileManager.GetInstance().OrderedTiles[TileType.Finish]; for (var i = 0; i < startingTiles.Count; i++) { if (i < agents.Length) { agents[i].Initialize(startingTiles[i].TileLocation); //Debug.Log("AgentManager.Load(), finish: " + startingTiles[i].TileLocation.X + ", " + startingTiles[i].TileLocation.Y); agents[i].StateMachine.ChangeState(new DrivingToFinish()); } } }
protected AgentBehaviourBase(AgentBase agent) { Agent = agent; }