public void SwitchBuildingsLevel() { if (buildingsLevel >= 2) { buildingsLevel = -1; } buildingsLevel++; unitsLevel = -1; buildingToSpawn = (BuildingToSpawn)buildingsLevel; toSpawn.enabled = true; spawningBuilding = true; toSpawn.GetComponent <Image>().enabled = true; spawnCost.enabled = true; Debug.Log("buildingslevel = " + buildingsLevel); toSpawn.image.sprite = buildingsObjects[buildingsLevel].sprite; spawnCost.text = buildingsObjects[buildingsLevel].cost + "$"; }
/// <summary> /// This will update the next building which needs to be spawned. /// </summary> /// <param name="nextBuilding">The building to spawn. </param> public void m_SetBuildingToSpawn(BuildingToSpawn nextBuilding) { m_CurrentBuildingToSPawn = nextBuilding; }