Exemple #1
0
    public void SellTurret()
    {
        //The player sells the turret and gets X amount of gold. It spawns a particlesystem that destroys itself after 5 seconds and the isUpgraded boolean goes to false and there wont be a turretBlueprint anymore on the node
        PlayerStats.Money += turretBlueprint.GainSoldTurretCost();

        GameObject effect = (GameObject)Instantiate(buildManager.sellEffect, GetBuildPosition(), Quaternion.identity);

        Destroy(effect, 5f);

        isUpgraded = false;
        Destroy(turret);
        turretBlueprint = null;
    }