Ejemplo n.º 1
0
 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);
     }
 }
Ejemplo n.º 2
0
 // 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)
 }
Ejemplo n.º 3
0
 // Add target to list
 public void addTarget(CanReceiveDamage target)
 {
     targets.Add(target);
 }
Ejemplo n.º 4
0
 // For empty shot without colliding with anyone
 public void Shoot(Vector3 targetPosition)
 {
     target          = null;
     target_position = targetPosition;
 }
Ejemplo n.º 5
0
 public void Shoot(CanReceiveDamage target, float damage)
 {
     this.target          = target;
     this.target_position = target.getGameObject().transform.position;
     this.damage          = damage;
 }