void OnDestroy()
        {
            PlayerPrefs.SetFloat(windowPositionX, this.windowRect.x);
            PlayerPrefs.SetFloat(windowPositionY, this.windowRect.y);
            PlayerPrefs.SetString(bundleNameKey, this.bundleName);

            if (this.simulationRunner != null)
            {
                this.simulationRunner.OnDestroy();
                this.simulationRunner = null;
            }
        }
        IMediaboxServer IMediaboxServerFactory.Create()
        {
            if (GameDefinitionSettings.Load().ServerMode != ServerMode.Simulation)
            {
                Debug.Log($"{nameof(GameDefinitionSettings)}.{nameof(GameDefinitionSettings.ServerMode)} is not {nameof(ServerMode)}.{nameof(ServerMode.Simulation)}. Returning null.");
                return(null);
            }

            Debug.Log($"Creating new{nameof(StreamingAssetsMediaboxServer)}");

            if (this.simulationRunner == null)
            {
                this.simulationRunner = new SimulationModeRunner(new UnityPlayerPrefs(), () => true, () => this.mediaboxServer);
            }

            this.mediaboxServer = new StreamingAssetsMediaboxServer(bundleName, new GUIDialog());
            return(this.mediaboxServer);
        }