public RemoveEntity ( FSO.SimAntics.VMEntity entity ) : void | ||
entity | FSO.SimAntics.VMEntity | The entity to remove. |
리턴 | void |
public void RemoveEntity(VMEntity entity)
{
if (Entities.Contains(entity))
{
Context.SetToNextCache.RemoveObject(entity);
this.Entities.Remove(entity);
ObjectsById.Remove(entity.ObjectID);
if (entity.ObjectID < ObjectId) ObjectId = entity.ObjectID; //this id is now the smallest free object id.
}
entity.Dead = true;
}
public void RemoveObjectInstance(VMEntity target) { target.PrePositionChange(this); if (!target.GhostImage) { VM.RemoveEntity(target); } if (UseWorld) { if (target is VMGameObject) { Blueprint.RemoveObject((ObjectComponent)target.WorldUI); } else { Blueprint.RemoveAvatar((AvatarComponent)target.WorldUI); } } }