Ejemplo n.º 1
0
    private void Destruct()
    {
        if (this.gameObject.tag == "Tower")
        {
            transform.parent.GetComponent <PlacementController>().TowerDestroyed();
        }

        if (this.gameObject.tag == "Enemy")
        {
            int enemyValue = transform.GetComponent <Enemy>().enemyCashValue;
            resourceManager.AddCash(enemyValue);
        }

        Destroy(this.gameObject);
        GameObject expl = (GameObject)Instantiate(explosion, transform.position, transform.rotation);

        Destroy(expl, 1);
    }
Ejemplo n.º 2
0
 /// <summary>
 /// This method adds the specified amount of Cash to the players inventory.
 /// </summary>
 /// <param name="toAdd"></param>
 public void AddResources(float toAdd)
 {
     resourceManager.AddCash((int)toAdd);
 }