Exemplo n.º 1
0
 void Start()
 {
     buildmanager  = BuildManager.GetInstance;
     nodeUI        = buildmanager.nodeUISetter;
     standartTower = TowersShop.GetTower("Standart");
     missleTower   = TowersShop.GetTower("Missle");
     fireTower     = TowersShop.GetTower("Fire");
 }
Exemplo n.º 2
0
    //
    // Setting text
    //
    private void SetSellText()
    {
        NodeController node = bm.GetSelectedNode;
        TowerBlueprint tb   = TowersShop.GetTower(node.GetTowerTitle);

        if (tb != null)
        {
            sellText.text = "Sell\n$" + tb.sellCost;
        }
    }
Exemplo n.º 3
0
    private void SetShopText()
    {
        TowerBlueprint tbGun    = TowersShop.GetTower("Standart");
        TowerBlueprint tbMissle = TowersShop.GetTower("Missle");

        if (tbGun != null && tbMissle != null)
        {
            gunTowerText.text    = "Gun tower\n$" + tbGun.cost;
            MissleTowerText.text = "Missle tower\n$" + tbMissle.cost;
        }
    }
Exemplo n.º 4
0
 public void SellTower()
 {
     if (selectedNode != null)
     {
         TowerBlueprint towerBlueprint = TowersShop.GetTower(selectedNode.GetTowerTitle);
         if (towerBlueprint != null)
         {
             Destroy(selectedNode.tower);
             selectedNode.tower = null;
             PlayerStats.ChangeCurrency(towerBlueprint.sellCost);
         }
     }
 }
Exemplo n.º 5
0
 public void UpgradeTower()
 {
     if (selectedNode != null)
     {
         TowerBlueprint towerBlueprint = TowersShop.GetTower("Upgraded " + selectedNode.GetTowerTitle);
         if (towerBlueprint != null)
         {
             if (towerBlueprint != null && selectedNode != null && PlayerStats.ChangeCurrency(-towerBlueprint.cost))
             {
                 Destroy(selectedNode.tower);
                 SetTower(towerBlueprint);
             }
         }
     }
 }
Exemplo n.º 6
0
    private void SetUpgradeText()
    {
        NodeController node = bm.GetSelectedNode;
        TowerBlueprint tb   = TowersShop.GetTower(node.GetTowerTitle);

        if (tb != null)
        {
            if (tb.upgradeCost == 0)
            {
                upgradeText.text = "Can't\nupgrade";
            }
            else
            {
                upgradeText.text = "Upgrade\n$" + tb.upgradeCost;
            }
        }
    }