public void DestroyEntity(Entity entity)
        {
            foreach (var component in _components.Where(c => c.Entity == entity).ToArray())
            {
                DetachComponent(component);
            }

            if (entity.Name != null)
            {
                _entitiesByName.Remove(entity.Name);
            }

            _entities.Remove(entity);
            EntityDestroyed?.Invoke(this, entity);
        }
示例#2
0
 private void Sprite_AnimationDone()
 {
     EntityDestroyed?.Invoke(this);
 }
示例#3
0
 private void OnEntityDestroyed(Entity entity)
 {
     EntityDestroyed?.Invoke(entity);
 }
示例#4
0
文件: HcMap.cs 项目: umby24/ZBase
 public void EntityRemove(Entity e)
 {
     EntityDestroyed?.Invoke(e);
 }
示例#5
0
 public void Destroy(GameState gameState, Player player = null)
 {
     TileDestroyed?.Invoke(this, player);
     EntityDestroyed?.Invoke(this);
 }
示例#6
0
 internal void Destroyed()
 {
     EntityDestroyed?.Invoke(this, EventArgs.Empty);
 }
示例#7
0
 public void Destroy(GameState gameState)
 {
     EntityDestroyed?.Invoke(this);
 }