コード例 #1
0
        /// <inheritdoc />
        public override void LoadData()
        {
            if (!MyAPIGateway.Multiplayer.MultiplayerActive || !MyAPIGateway.Utilities.IsDedicated)
            {
                LoadLocalization();
                LoadSettings();
                ModifyDefinitions();

                MyAPIGateway.Gui.GuiControlRemoved += OnGuiControlRemoved;
                _chatHandler = new ChatHandler();
                _guiHandler  = new GuiHandler();
            }
        }
コード例 #2
0
        /// <inheritdoc />
        protected override void UnloadData()
        {
            if (!MyAPIGateway.Multiplayer.MultiplayerActive || !MyAPIGateway.Utilities.IsDedicated)
            {
                MyAPIGateway.Gui.GuiControlRemoved -= OnGuiControlRemoved;

                if (_guiHandler != null)
                {
                    _guiHandler.Close();
                    _guiHandler = null;
                }

                if (_chatHandler != null)
                {
                    _chatHandler.Close();
                    _chatHandler = null;
                }

                RevertDefinitions();
            }

            Static = null;
        }