Example #1
0
 // Do damage and remove all entries of this projectile and flag it for destruction
 // This is so to maintain a reference of the projectile until the end of the collision detection
 public void DestroyProjectile(Projectile projectile)
 {
     DoDamage(projectile);
     colliderIdWithProjectiles.Remove(projectile.collider.GetInstanceID());
     projectiles.Remove(projectile);
     flaggedForDestruction.Remove(projectile);
     Destroy(projectile.gameObject);
 }
Example #2
0
    public void DespawnPlayer(byte id)
    {
        BasePlayer player = players.GetObjWithId(id);

        if (player)
        {
            players.Remove(player);
            Destroy(player.gameObject);
        }
    }
Example #3
0
 // Delete the selectors with the id of the peer
 private void Disconnection(byte id, bool thisPeer)
 {
     if (!thisPeer)
     {
         PlayerSelector selector = GetSelectorFromID(id);
         if (selector)
         {
             selectorList.Remove(selector);
             Destroy(selector.gameObject);
         }
         // Delete all selectors when this peer is leaving
     }
     else
     {
         DeleteAllSelectors();
     }
 }
Example #4
0
 public void DeleteEnemy(BaseEnemy enemy)
 {
     enemies.Remove(enemy);
     Destroy(enemy.gameObject);
 }