// This is to receive the simulator and increment slider from the game loop, and to set // all the labels afterwards // This also receives the funding manager that handles construction costs and demolition costs (or recouped funds from demolition) public void SetSimulator(IZoningControls simulator, Slider incrementSlider, FundingManager fundingManager) { _incrementSlider = incrementSlider; _simulator = simulator; _fundingMgr = fundingManager; _incrementSlider.onValueChanged.AddListener(UpdateConstructionCostText); UpdateBldgSizeText(0); UpdateTextLabels(); }
// This is to receive the simulator and increment slider from the game loop, and to set // all the labels afterwards public void SetSimulator(ICivicControls simulator, Slider incrementSlider, FundingManager fundingManager) { _incrementSlider = incrementSlider; _fundingMgr = fundingManager; _simulator = simulator; _breakdownTextBuffer = new string[_simulator.ConstBuildingTypes.Length]; _textBldgType.text = $"{_labelBuildingType}: {_simulator.ConstBuildingTypes[0]}\n({_simulator.ConstBuildingSeats[0]} {_labelGeneralSeatName})"; UpdateTextLabels(); UpdateBldgTypeText(0); }
private void Awake() { _textPopulation.text = "Population: 0"; _textEmployment.text = "Employment: 0"; _fundingMgr = new FundingManager(_initialFunds, _textFunds, _textIncome); _textFunds.text = $"Funds: {_initialFunds}"; _textIncome.text = ""; _resCtrl.SetSimulator(_resSim, _incrementCtrl._incrementSlider, _fundingMgr); _commCtrl.SetSimulator(_commSim, _incrementCtrl._incrementSlider, _fundingMgr); _eduCtrl.SetSimulator(_eduSim, _incrementCtrl._incrementSlider, _fundingMgr); _hlthCtrl.SetSimulator(_hlthSim, _incrementCtrl._incrementSlider, _fundingMgr); }