예제 #1
0
    private void upgradeTurret(GameObject turret)
    {
        TurretScript turretScript = turret.GetComponent <TurretScript>();

        if (turretScript.getUpgradeCost() > points)
        {
            Debug.Log("UPGRADE TOO EXPENSIVE");
            return;
        }
        turretScript.addDamage(1);
        turretScript.addFireRatio(10);
        turretScript.addPierce(1);
        turretScript.addRange(1);
        turretScript.addProjectyleSpeed(1);
        points -= turretScript.getUpgradeCost();
        Debug.Log("Turret Upgraded!");
    }