コード例 #1
0
    public void BuildTurretOn(NodeScript node)
    {
        if (TD_Stats.Experience < turretTobuild.cost)
        {
            Debug.Log("Not enough Experience");
            return;
        }

        TD_Stats.Experience -= turretTobuild.cost;

        GameObject turret = Instantiate(turretTobuild.prefab, node.GetBuildPos(), Quaternion.identity);

        node.WBCTurret = turret;

        GameObject Effect = Instantiate(BuildEffect, node.GetBuildPos(), Quaternion.identity);

        Destroy(Effect, 4f);

        Debug.Log("WBC Placed! " + "Experience Left" + TD_Stats.Experience);
    }
コード例 #2
0
    public void BuildTurretHere(NodeScript node)
    {
        if (PlayerStats.resources < BuildThisTurret.buildCost)
        {
            //TODO: POPUP on UI!
            Debug.Log("We require more minerals");
            return;
        }

        PlayerStats.resources -= BuildThisTurret.buildCost;
        GameObject turret = Instantiate(BuildThisTurret.prefab, node.GetBuildPos(), Quaternion.identity);

        node.turret = turret;

        //TODO: Show resources in UI!
        Debug.Log("Very Well. this turret will be conjured..... You have " + PlayerStats.resources + " left");
    }
コード例 #3
0
    public void SetTarget(NodeScript _target)
    {
        target             = _target;
        transform.position = target.GetBuildPos();
        if (!target.isMaxxed)
        {
            upgradeID                  = target.UpgradeID;
            upgradeCost.text           = "$" + target.turretBlueprint.cost[upgradeID];
            upgradeButton.interactable = true;
        }
        else
        {
            upgradeCost.text           = "Max lvl";
            upgradeButton.interactable = false;
        }

        sellAmt.text = "$" + target.turretBlueprint.GetSellAmount(upgradeID);
        UI.SetActive(true);
    }