コード例 #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);
 }
コード例 #2
0
    public void DespawnPlayer(byte id)
    {
        BasePlayer player = players.GetObjWithId(id);

        if (player)
        {
            players.Remove(player);
            Destroy(player.gameObject);
        }
    }
コード例 #3
0
ファイル: LobbyMenu.cs プロジェクト: melisj/P2P-Network-Game
 // 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();
     }
 }
コード例 #4
0
 public void DeleteEnemy(BaseEnemy enemy)
 {
     enemies.Remove(enemy);
     Destroy(enemy.gameObject);
 }