예제 #1
0
 void Start()
 {
     buildmanager  = BuildManager.GetInstance;
     nodeUI        = buildmanager.nodeUISetter;
     standartTower = TowersShop.GetTower("Standart");
     missleTower   = TowersShop.GetTower("Missle");
     fireTower     = TowersShop.GetTower("Fire");
 }
예제 #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;
        }
    }
예제 #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;
        }
    }
예제 #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);
         }
     }
 }
예제 #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);
             }
         }
     }
 }
예제 #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;
            }
        }
    }