Beispiel #1
0
    public void SellTurret()
    {
        Destroy(turret);

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

        Destroy(effect, 10f);

        StatsManager.Money += turretBlueprint.GetSellValue();
        turretBlueprint     = null;
    }
Beispiel #2
0
    /// <summary>
    /// Sell a selected turret
    /// </summary>
    public void SellTurret()
    {
        PlayerStats.Money += turretBlueprint.GetSellValue();

        //Create a selleffect object
        GameObject sellEffect          = (GameObject)Instantiate(buildManager.sellEffect, GetBuildPosition(), Quaternion.identity);
        GameObject turretDestroyEffect = (GameObject)Instantiate(buildManager.destroyEffect, GetBuildPosition(), Quaternion.identity);

        Destroy(sellEffect, 5f);
        Destroy(turretDestroyEffect, 5f);

        Destroy(turret);
        turretBlueprint = null;
    }
Beispiel #3
0
    public void SellTurret()
    {
        PlayerAttributes.Money += turretBlueprint.GetSellValue();

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

        Destroy(effect, 5f);

        Destroy(turret);

        turretBlueprint = null;
        isUpgraded      = false;

        Debug.Log("Turret Sold!");
    }
Beispiel #4
0
    public void SellTurret()
    {
        // Add money at half the cost spent
        PlayerStats.Money += turretBlueprint.GetSellValue(tower.turretMaximized);
        // Destroy turret and kill references
        Destroy(turret);
        turret = null;

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

        Destroy(effect, 5f);

        // Update money counter
        Debug.Log("Turret sold!");
        PlayerStats.UpdateMoney();
    }
Beispiel #5
0
    public void SellTurret()
    {
        // Add money at half the cost spent
        PlayerStats.Money += turretBlueprint.GetSellValue(towerBuilded.numberOfUpgrades);
        // Destroy turret and kill references
        turret.SetActive(false);
        turret = null;

        // Play effect
        //GameObject effect = Instantiate(buildManager.sellEffect, GetBuildPosition(), Quaternion.identity);
        //Destroy(effect, 5f);
        StartCoroutine(Effect.PlayEffect(sellEffect, transform));

        // Update money counter
        Debug.Log("Turret sold!");
        PlayerStats.UpdateMoney();
    }