public void SetPothole(PotholeManager potholeManager, float repairTime, PotholeSize potholeSize) { this.gameManager = FindObjectOfType <GameManager>(); this.potholeManager = potholeManager; this.repairTime = repairTime; this.size = potholeSize; this.timeSinceSpawn = 0.0f; this.carCount = 0; }
void Start() { Time.timeScale = 1; GridStructure grid = new GridStructure(2, gridSize); grid = GetGridStructure(grid); potholeManager = new PotholeManager(grid, roadRepository, placementManager, workerNumber); placementManager.cityRoads = roadsParent.transform; //Subscribers //Worker count init AddListenerOnWorkerCountInitEvent((workerCount) => uiController.InitWorkerIcons(workerCount)); AddListenerOnWorkerCountInitEvent((workerCount) => uiController.overviewController.InitWorkerIcons(workerCount)); //Available worker count change potholeManager.AddListenerOnAvailableWorkerChangeEvent((workerCount) => uiController.ChangeWorkerColor(workerCount)); potholeManager.AddListenerOnAvailableWorkerChangeEvent((workerCount) => uiController.overviewController.ChangeWorkerColor(workerCount)); potholeManager.AddListenerOnAvailableWorkerChangeEvent((workerCount) => uiController.assignWorkerController.DisableWorkers(workerCount)); //Pothole counter change potholeManager.AddListenerOnPotholeCountChangeEvent((potholeCount) => uiController.ChangePotholeCount(potholeCount)); potholeManager.AddListenerOnPotholeCountChangeEvent((potholeCount) => uiController.overviewController.ChangePotholeCount(potholeCount)); OnWorkerCountInitEvent?.Invoke(workerNumber); }
private void Awake() { Instance = this; }