public virtual void Remove() { if (!isRemovable) { return; } RemoveComponentFromVisibilityMap(); ComponentsManager.Replace(this, new EmptyComponent(ID)); if (MicroWorld.Graphics.GUI.GUIEngine.ContainsHUDScene(ToolTip)) { MicroWorld.Components.ComponentsManager.closingProperties.Add(ToolTip); ToolTip.Close(); } if (MicroWorld.Graphics.GUI.GUIEngine.s_subComponentButtons.isVisible && MicroWorld.Graphics.GUI.GUIEngine.s_subComponentButtons.SelectedComponent == this) { MicroWorld.Graphics.GUI.GUIEngine.RemoveHUDScene(MicroWorld.Graphics.GUI.GUIEngine.s_subComponentButtons); MicroWorld.Graphics.GUI.GUIEngine.s_subComponentButtons.SelectedComponent = null; MicroWorld.Graphics.GUI.GUIEngine.s_subComponentButtons.isVisible = false; } Statistics.ComponentsRemoved++; GlobalEvents.OnComponentRemoved(this); }
public override void Remove() { ComponentsManager.Replace(this, new EmptyComponent(ID)); UnRegisterColliders(); collisions.Clear(); length = preCollisionLength; }