public void EnableClickers() { // houses BuildingClicker houseSmallClicker = houseSmallClickerObject.GetComponent <BuildingClicker>(); houseSmallClicker.UpdateEnableInput(gameData); BuildingClicker houseMediumClicker = houseMediumClickerObject.GetComponent <BuildingClicker>(); houseMediumClicker.UpdateEnableInput(gameData); BuildingClicker houseLargeClicker = houseLargeClickerObject.GetComponent <BuildingClicker>(); houseLargeClicker.UpdateEnableInput(gameData); // resources BuildingClicker farmClicker = farmClickerObject.GetComponent <BuildingClicker>(); farmClicker.UpdateEnableInput(gameData); BuildingClicker foresterClicker = foresterClickerObject.GetComponent <BuildingClicker>(); foresterClicker.UpdateEnableInput(gameData); BuildingClicker quarryClicker = quarryClickerObject.GetComponent <BuildingClicker>(); quarryClicker.UpdateEnableInput(gameData); // satisfaction BuildingClicker cemeteryClicker = cemeteryClickerObject.GetComponent <BuildingClicker>(); cemeteryClicker.UpdateEnableInput(gameData); BuildingClicker clinicClicker = clinicClickerObject.GetComponent <BuildingClicker>(); clinicClicker.UpdateEnableInput(gameData); BuildingClicker tavernClicker = tavernClickerObject.GetComponent <BuildingClicker>(); tavernClicker.UpdateEnableInput(gameData); }
public void Load() { Transform pParent = transform; // Prefabs for (int i = 0; i < 100; ++i) { // tree GameObject goTree = Instantiate(prefabTree); TreeHandler treeHandler = goTree.GetComponent <TreeHandler>(); treeHandler.Load(pParent); treeObjectPool.Enqueue(goTree); // stone GameObject goStone = Instantiate(prefabStone); StoneHandler stoneHandler = goStone.GetComponent <StoneHandler>(); stoneHandler.Load(pParent); stoneObjectPool.Enqueue(goStone); // food GameObject goFood = Instantiate(prefabFood); FoodHandler foodHandler = goFood.GetComponent <FoodHandler>(); foodHandler.Load(pParent); foodObjectPool.Enqueue(goFood); } // Preloads PlayController pc = PlayController.main; BuildingsHandler buildingsHandler = buildingsHandlerObject.GetComponent <BuildingsHandler>(); buildingsHandler.Load(); // houses BuildingClicker houseClicker = houseSmallClickerObject.GetComponent <BuildingClicker>(); houseClicker.Load(pc.gameData.houseSmallResourceCost); houseClicker = houseMediumClickerObject.GetComponent <BuildingClicker>(); houseClicker.Load(pc.gameData.houseMediumResourceCost); houseClicker = houseLargeClickerObject.GetComponent <BuildingClicker>(); houseClicker.Load(pc.gameData.houseLargeResourceCost); // resources BuildingClicker satisfactionClicker = farmClickerObject.GetComponent <BuildingClicker>(); satisfactionClicker.Load(pc.gameData.farmResourceCost); BuildingClicker resourceClicker = foresterClickerObject.GetComponent <BuildingClicker>(); resourceClicker.Load(pc.gameData.foresterResourceCost); resourceClicker = quarryClickerObject.GetComponent <BuildingClicker>(); resourceClicker.Load(pc.gameData.quarryResourceCost); // satisfaction resourceClicker = cemeteryClickerObject.GetComponent <BuildingClicker>(); resourceClicker.Load(pc.gameData.cemeteryResourceCost); satisfactionClicker = clinicClickerObject.GetComponent <BuildingClicker>(); satisfactionClicker.Load(pc.gameData.clinicResourceCost); satisfactionClicker = tavernClickerObject.GetComponent <BuildingClicker>(); satisfactionClicker.Load(pc.gameData.tavernResourceCost); OnLoadComplete?.Invoke(); }