Example #1
0
 public void CreateUnitTower()
 {
     Debug.Log("Create Unit Tower");
     if (!init)
     {
         tower = Instantiate(choices[2].prefab, transform.position, Quaternion.identity) as GameObject;
         manager.AddGold(-1 * choices[2].cost);
         currTower = choices[2];
         tower.transform.parent = this.transform;
         init = true;
     }
     // Functionality for slow tower construction here
     DisableTowerButtons();
 }
Example #2
0
 public void CreateSlowTower()
 {
     Debug.Log("Create Slow Tower");
     if (!init)
     {
         tower = Instantiate(choices[1].prefab, transform.position, Quaternion.identity) as GameObject;
         manager.AddGold(-1 * choices[1].cost);
         currTower = choices[1];
         tower.transform.parent = this.transform;
         init = true;
     }
     else if (currTower.type == TowerType.slow)
     {
         Destroy(tower);
         tower = Instantiate(choices[currTower.upgradeOptions[0]].prefab, transform.position, Quaternion.identity) as GameObject;
         manager.AddGold(-1 * choices[currTower.upgradeOptions[0]].cost);
         currTower = choices[currTower.upgradeOptions[0]];
         tower.transform.parent = this.transform;
     }
     // Functionality for slow tower construction here
     DisableTowerButtons();
 }