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