コード例 #1
0
        private void OnConsoleCommandEntered(string command)
        {
            if (command.Equals("weather"))
            {
                isWeatherEnabled = !isWeatherEnabled;

                if (!isWeatherEnabled)
                {
                    WeatherManager.main.debugLightningEnabled     = false;
                    WeatherManager.main.debugPrecipitationEnabled = false;
                    WeatherManager.main.debugWindEnabled          = false;
                    GameModeUtils.ActivateCheat(GameModeOption.NoCold);
                }
                else
                {
                    WeatherManager.main.debugLightningEnabled     = true;
                    WeatherManager.main.debugPrecipitationEnabled = true;
                    WeatherManager.main.debugWindEnabled          = true;
                    GameModeUtils.DeactivateCheat(GameModeOption.NoCold);
                }
            }

            UpdateButtonsState();
            Debug.Log(command);
        }
コード例 #2
0
        private void ToggleCheat(ToggleChangedEventArgs e)
        {
            if (Player.main != null)
            {
                if (Enum.TryParse(e.Id, out GameModeOption option))
                {
                    if (e.Value)
                    {
                        GameModeUtils.ActivateCheat(option);
                    }
                    else
                    {
                        GameModeUtils.DeactivateCheat(option);
                    }
                }
                else if (NoCostConsoleCommand.main != null)
                {
                    switch (e.Id)
                    {
                    case "FastBuild":
                        NoCostConsoleCommand.main.fastBuildCheat = e.Value;
                        break;

                    case "FastGrow":
                        NoCostConsoleCommand.main.fastGrowCheat = e.Value;
                        break;

                    case "FastHatch":
                        NoCostConsoleCommand.main.fastHatchCheat = e.Value;
                        break;

                    case "FastScan":
                        NoCostConsoleCommand.main.fastScanCheat = e.Value;
                        break;
                    }
                }
            }
        }