public RemoveObjectInstance ( FSO.SimAntics.VMEntity target ) : void | ||
target | FSO.SimAntics.VMEntity | |
리턴 | void |
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);
}
if (VM.EODHost != null)
{
VM.EODHost.ForceDisconnectObj(target);
}
}
public void Delete(bool cleanupAll,VMContext context) { if (cleanupAll) { MultitileGroup.Delete(context); } else { var threads = SoundThreads; for (int i = 0; i < threads.Count; i++) { threads[i].Sound.RemoveOwner(ObjectID); } threads.Clear(); PrePositionChange(context); context.RemoveObjectInstance(this); MultitileGroup.RemoveObject(this); //we're no longer part of the multitile group int slots = TotalSlots(); for (int i = 0; i < slots; i++) { var obj = GetSlot(i); if (obj != null) { obj.SetPosition(Position,obj.Direction,context); } } } }