private void Start() { Instance = this; StartCoroutine(FindModSelector()); Directory.CreateDirectory(MissionsFolder); GetComponent <KMGameInfo>().OnStateChange += state => { if (state == KMGameInfo.State.Setup) { if (prevRuleSeed.HasValue) { var obj = GameObject.Find("VanillaRuleModifierProperties"); var dic = obj?.GetComponent <IDictionary <string, object> >(); if (dic != null) { dic["RuleSeed"] = new object[] { prevRuleSeed, true } } ; prevRuleSeed = null; } StartCoroutine(RestoreModeSettingsLate()); } }; }
private void Start() { Instance = this; StartCoroutine(FindModSelector()); Directory.CreateDirectory(MissionsFolder); GetComponent <KMGameInfo>().OnStateChange += state => { if (state == KMGameInfo.State.Setup) { StartCoroutine(RestoreSettingsLate()); } }; }
private void Start() { Instance = this; StartCoroutine(FindModSelector()); Directory.CreateDirectory(MissionsFolder); GetComponent <KMGameInfo>().OnStateChange += state => { // If we are leaving the gameplay room, clear room override. if (currentState == KMGameInfo.State.Gameplay && state != KMGameInfo.State.Gameplay && MissionInputPage.GameplayRoomOverride != null) { MissionInputPage.GameplayRoomOverride = null; ReflectionHelper.FindType("GameplayState").SetValue("GameplayRoomPrefabOverride", null); } currentState = state; if (state == KMGameInfo.State.Setup) { StartCoroutine(RestoreSettingsLate()); } }; }