public void Initialize(CellGrid cellGrid, BehaviorTree agentBehaviorTree, Pathfinder pathfinder) { CellGrid = cellGrid; behaviorTree = agentBehaviorTree; data.LoadData(); stats.Initialize(this); simpleVehicleModel.Initialize(); movementController.Initialize(cellGrid, pathfinder); movementController.EnableAllPathingImprovements(); //movementController.Toggle_CanJump(true); DisableAllMovementVisualization(); }
public void CreateBoids(int boidCount) { for (int i = 0; i < boidCount; i++) { SimpleVehicleModel boid = Instantiate(boidPrefab).GetComponent <SimpleVehicleModel>(); boid.gameObject.name = string.Format("Boid #{0}", i.ToString()); boid.Initialize(); boid.transform.position = cellGrid.GetRandomCell_ObstacleFree(0).transform.position + new Vector3(0f, 0.5f, 0f); boids.Add(boid); } }