public void Load() { if (_prefabFlag || GameController.Instance.isInScenarioEditor) { return; } if (isLoaded) { this.Unload(); } if (settings == null) { settings = new MoreRealismSettings(); } windows.Add(new MainWindow(this)); windows.Add(new MessageBoxWindow(this)); windows.Add(new DebuggingWindow(this)); GameController.Instance.addSerializedObject(this); isLoaded = true; string notif = "You are currently playing on a park with these options enabled :\n"; notif += this.settings.dayNightCycleEnabled ? "\n- Day/night cycle" : ""; notif += this.settings.kickOutGuestsAtNight ? "\n- Close the park for half of the night" : ""; notif += this.settings.closeEverythingAtNight ? "\n- Close attractions and shops for half of the night" : ""; GetWindow <MessageBoxWindow>().Show(notif, 350, 150); }
public override void deserialize(SerializationContext context, Dictionary <string, object> values) { if (_prefabFlag) { return; } settings = new MoreRealismSettings(); settings.deserialize(context, values); base.deserialize(context, values); Instance.Kill(); Instance = this; EventManager.Instance.OnStartPlayingPark += Instance.Load; }