Пример #1
0
        private static bool Prefix(SpeedControlScreen __instance)
        {
            //Debug.Log(" === SpeedControlMod INI === ");

            if (__instance.IsPaused)
            {
                Time.timeScale = 0f;
            }
            else if (__instance.GetSpeed() == 0)
            {
                Time.timeScale = __instance.normalSpeed;
            }
            else if (__instance.GetSpeed() == 1)
            {
                Time.timeScale = __instance.fastSpeed;
            }
            else if (__instance.GetSpeed() == 2)
            {
                Time.timeScale = 10f;
            }

            //__instance.OnGameSpeedChanged?.Invoke();

            //Debug.Log(" === SpeedControlMod END === ");

            return(false);
        }
Пример #2
0
        public static bool Prefix(SpeedControlScreen __instance)
        {
            if (GameOnLoadPatch.Settings == null)
            {
                GameOnLoadPatch.ReadSettings();
            }

            if (__instance.IsPaused)
            {
                Time.timeScale = 0f;
            }
            else
            {
                switch (__instance.GetSpeed())
                {
                case 0:
                    Time.timeScale = GameOnLoadPatch.Settings.slowSpeed;
                    break;

                case 1:
                    Time.timeScale = GameOnLoadPatch.Settings.normalSpeed;
                    break;

                case 2:
                    Time.timeScale = GameOnLoadPatch.Settings.superSpeed;
                    break;

                default:
                    break;
                }
            }
            return(false);
        }
        private static bool Prefix(SpeedControlScreen __instance)
        {
            if (__instance.IsPaused)
            {
                Time.timeScale = 0f;
            }
            else if (__instance.GetSpeed() == 0)
            {
                Time.timeScale = __instance.normalSpeed;
            }
            else if (__instance.GetSpeed() == 1)
            {
                Time.timeScale = __instance.ultraSpeed;
            }
            else if (__instance.GetSpeed() == 2)
            {
                Time.timeScale = 6f;
            }

            return(false);
        }
        private static bool Prefix(SpeedControlScreen __instance)
        {
            if (!SpeedControlConfig.Instance.Enabled)
            {
                return(true);
            }

            if (SpeedControlConfig.Instance.Logging)
            {
                Debug.Log(" === SpeedControl INI === " + Time.timeScale);
            }

            if (__instance.IsPaused)
            {
                Time.timeScale = 0f;
            }
            else if (__instance.GetSpeed() == 0)
            {
                Time.timeScale = SpeedControlConfig.Instance.SpeedMultiplier1;
            }
            else if (__instance.GetSpeed() == 1)
            {
                //Time.timeScale = __instance.fastSpeed;
                Time.timeScale = SpeedControlConfig.Instance.SpeedMultiplier2;
            }
            else if (__instance.GetSpeed() == 2)
            {
                Time.timeScale = SpeedControlConfig.Instance.SpeedMultiplier3;
            }

            //__instance.OnGameSpeedChanged?.Invoke();

            if (SpeedControlConfig.Instance.Logging)
            {
                Debug.Log(" === SpeedControl END === " + Time.timeScale);
            }

            return(false);
        }