Beispiel #1
0
    public void SelectTurretToBuild(TurretsBlueprint turret)
    {
        turretToBuild  = turret;
        selectedTurret = null;

        selectUI.HideUI();
    }
Beispiel #2
0
 public void SellTurret()
 {
     if (!isUpgraded)
     {
         PlayerStats.Gold += turretsBlueprint.GetSellAmount();
     }
     else
     {
         PlayerStats.Gold += turretsBlueprint.GetUpgradeSellAmount();
     }
     Destroy(turret);
     turretsBlueprint = null;
     isUpgraded       = false;
 }
Beispiel #3
0
    void BuildTurret(TurretsBlueprint blueprint)
    {
        if (PlayerStats.Gold < blueprint.cost)
        {
            Debug.Log("Not enouth gold");
            //TODO On Screen display
            return;
        }

        PlayerStats.Gold -= blueprint.cost;
        GameObject _turret = (GameObject)Instantiate(blueprint.prefab, GetBuildPosition(), Quaternion.identity);
        GameObject effect  = (GameObject)Instantiate(buildMenu.buildEffect, GetBuildPosition(), Quaternion.identity);

        Destroy(effect, 5f);

        //Cant build multiple turrets on 1 select
        //blueprint = null;
        //Optional
        turret           = _turret;
        turretsBlueprint = blueprint;
        Debug.Log("Turret Build! Money left " + PlayerStats.Gold);
    }
Beispiel #4
0
 public void SelectTurret(TurretsPlaces turretPlace)
 {
     selectedTurret = turretPlace;
     turretToBuild  = null;
     selectUI.GetTarget(turretPlace);
 }