public void notifyDeath(CanReceiveDamage dead) { if (dead is Building) { Debug.Log("GAME OVER Mate."); PersistentValues.victory = 0; SceneManager.LoadScene("FinalSceneLose"); } else if (dead is Unit) { Debug.Log(((Unit)dead).name + " is dead."); GameObject.FindGameObjectWithTag("Human").GetComponent <Player>().GetMoney((Unit)dead); } }
// Remove target from list public void removeTarget(CanReceiveDamage target) { targets.Remove(target); // TODO Careful! This is not the moment when the enemy dies (it is just removed from the target list) }
// Add target to list public void addTarget(CanReceiveDamage target) { targets.Add(target); }
// For empty shot without colliding with anyone public void Shoot(Vector3 targetPosition) { target = null; target_position = targetPosition; }
public void Shoot(CanReceiveDamage target, float damage) { this.target = target; this.target_position = target.getGameObject().transform.position; this.damage = damage; }