Esempio n. 1
0
        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());
                }
            };
        }
Esempio n. 2
0
        private void Start()
        {
            Instance = this;

            StartCoroutine(FindModSelector());

            Directory.CreateDirectory(MissionsFolder);
            GetComponent <KMGameInfo>().OnStateChange += state =>
            {
                if (state == KMGameInfo.State.Setup)
                {
                    StartCoroutine(RestoreSettingsLate());
                }
            };
        }
Esempio n. 3
0
        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());
                }
            };
        }