void Start() { _clockUiScript = GetComponent <ClockUIScript>(); _foodManager = GetComponent <FoodManagerScript>(); Player.transform.position = Spaces[0].transform.position; _spaces = Spaces.Count - 1; // transforms the amount of spaces for easy use. And for easy use when making the map bigger. }
void Start() { _foodManager = PlayerInfo.GetComponent <FoodManagerScript>(); for (int i = 0; i < FoodButtons.Length; i++) //Set the price and name on the buttons. { FoodButtons[i].transform.GetChild(0).GetComponent <Text>().text = FoodName[i].PadRight(20) + FoodPrice[i] + "$"; } }
void Start() { _clockUIScript = GetComponent <ClockUIScript>(); _p2pMovingManager = GetComponent <PointToPointMoveManagerScript>(); _playerInfoManager = GetComponent <PlayerInfoManagerScript>(); _bankManager = GetComponent <BankManagerScript>(); _foodManager = GetComponent <FoodManagerScript>(); }
//Ensures GameController is a singleton void Awake() { if(gameController != null) { Destroy(this.gameObject); } else { gameController = this; } populationManager = gameObject.AddComponent<PopulationManagerScript>(); foodManager = gameObject.AddComponent<FoodManagerScript> (); pollutionManager = gameObject.AddComponent <PollutionManagerScript> (); materialManager = gameObject.AddComponent<MaterialManagerScript> (); previousPopulation = totalPopulation; }