Esempio n. 1
0
    public void SetTarget(spots _target)
    {
        //passes in the target to this script.
        target = _target;
        //set the position of the UI to the node
        transform.position = target.GetBuildPosition();

        //update the cost to upgrade text into the upgrade button
        if (!target.is_upgraded)
        {
            upgrade_cost.text           = "$" + target.turret_blueprint.upgrade_cost;
            upgrade_button.interactable = true;
        }
        else
        {
            upgrade_cost.text           = "MAXED";
            upgrade_button.interactable = false;
        }

        //update the sell amount to the sell text in UI.
        sell_amount.text = "$" + target.turret_blueprint.GetSellAmount();

        //reveal the UI for the player
        ui.SetActive(true);

        selected = true;
    }
Esempio n. 2
0
 public void SelectTrapToBuild(TrapBlueprint _trap)
 {
     build_trap    = _trap;
     selected_node = null;
     build_turret  = null;
     DeselectNode();
 }
Esempio n. 3
0
 public void SelectTurretToBuild(TurretBlueprint _turret)
 {
     build_turret  = _turret;
     selected_node = null;
     build_trap    = null;
     DeselectNode();
 }
Esempio n. 4
0
 public void DeselectNode()
 {
     selected_node = null;
     turretUI.Hide();
     shop.archer_selected    = false;
     shop.slauncher_selected = false;
     shop.flame_selected     = false;
     shop.mortar_selected    = false;
 }
Esempio n. 5
0
    public void SelectNode(spots _spot)
    {
        if (selected_node == _spot)
        {
            DeselectNode();
            return;
        }

        selected_node = _spot;
        build_turret  = null;
        build_trap    = null;
        turretUI.SetTarget(_spot);
        shop.archer_selected    = false;
        shop.slauncher_selected = false;
        shop.flame_selected     = false;
        shop.mortar_selected    = false;
    }
Esempio n. 6
0
 public void pass_spots(spots _myspot)
 {
     spots_scr = _myspot;
 }