예제 #1
0
파일: Node.cs 프로젝트: Smorgames/CubeTD
    public void SellTurret()
    {
        if (isUpgraded)
        {
            PlayerStats.Money += turretBlueprint.GetSellAmountOfUpgrade();
        }
        else
        {
            PlayerStats.Money += turretBlueprint.GetSellAmount();
        }

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

        Destroy(effect, 5f);

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