protected void RemoveGuiComponent(GuiBase gui) { if (gui != null && !(gui is Cursor) && guiComponents.Exists(x => string.Equals(x.Name, gui.Name))) { guiComponents.Remove(gui); gui.CallMethod("UnloadContent", null); gui.Dispose(); } }
protected void AddGuiComponent(GuiBase gui) { if (gui != null && !(gui is Cursor) && !guiComponents.Exists(x => string.Equals(x.Name, gui.Name))) { gui.Initialize(); gui.CallMethod("LoadContent", null); guiComponents.Add(gui); } }