예제 #1
0
    public void SetTarget(NodeScript target)
    {
        this.target = target;

        transform.position = target.GetBuildPosition();
        ui.SetActive(true);
    }
예제 #2
0
    public void BuildTurretOn(NodeScript node)
    {
        if (PlayerStats.Money < turretToBuild.cost)
        {
            Debug.Log("Not enough money to build that");
            return;
        }

        PlayerStats.Money -= turretToBuild.cost;
        Debug.Log("Money left: " + PlayerStats.Money);
        GameObject obj = (GameObject)Instantiate(turretToBuild.prefab, node.GetBuildPosition(), node.transform.rotation);

        node.turret = obj;
    }
    public void BuildTurretOn(NodeScript nodeScript)
    {
        if (PlayerStatsScript.money < turretBlueprint.cost)
        {
            Debug.Log("You're broke bitch!");
            return;
        }

        PlayerStatsScript.money -= turretBlueprint.cost;

        GameObject turret = Instantiate(turretBlueprint.prefab, nodeScript.GetBuildPosition(), Quaternion.identity);

        nodeScript.turret = turret;

        Debug.Log("turret build!  you have $" + PlayerStatsScript.money);
    }
예제 #4
0
    public void SetTarget(NodeScript _target)
    {
        target             = _target;
        transform.position = target.GetBuildPosition();

        if (target.isUpgraded)
        {
            upgradeButton.interactable = false;
            upgradeCost.text           = "∞";
        }
        else
        {
            upgradeButton.interactable = true;
            upgradeCost.text           = "Ƀ" + target.turretBlueprint.upgradeCost.ToString();
        }

        sellingPrice.text = "Ƀ" + target.turretBlueprint.sellingPrice.ToString();
        UI.SetActive(true);
    }
예제 #5
0
 public void SetTarget(NodeScript target)
 {
     node = target;
     transform.position = node.GetBuildPosition();
 }