public static void OnUpdate() { if (!hasStartedLate) { return; } else { if (!FrameFocus.allowFrameLimit.Value) // false { return; // ends method } else // true { if (XRDevice.isPresent) { return; // If in VR all frame limits are disabled } if (Application.isFocused) // isFocused = If you are controlling the game a.k.a. if your mouse has been pressed onto the game { if (FrameFocus.override_emmVRC.Value && ModCompatibility.emmVRC) // ignored emmVRC integration { Application.targetFrameRate = (int)FrameFocus.FrameLimit.Value; // Sets game's FrameRate to Given Target FPS } else if (ModCompatibility.emmVRC) { Application.targetFrameRate = (int)GETemmVRCconfig.ReadConfig().FPSLimit; } else if (ModCompatibility.emmVRC && GETemmVRCconfig.ReadConfig().UnlimitedFPSEnabled) { Application.targetFrameRate = (int)300; } else { Application.targetFrameRate = (int)FrameFocus.FrameLimit.Value; // Sets game's FrameRate to Given Target FPS } } else { Application.targetFrameRate = (int)FrameFocus.FrameLimitUnfocused.Value; // Sets game's FrameRate to target FPS } } } }
public static IEnumerator RunCompatibilityCheck() { yield return(new WaitForSeconds(5)); try { if ((MelonHandler.Mods.FindIndex((MelonMod i) => i.Info.Name == "emmVRCLoader") != -1) || MelonHandler.Mods.FindIndex((MelonMod i) => i.Info.Name == "emmVRC") != -1) { emmVRC = true; if (FrameFocus.isDebug) { MelonLogger.Msg("[Debug] Detected emmVRC, I will be using emmVRC's config for values."); } GETemmVRCconfig.LoadConfig(); } } catch { MelonLogger.Msg("[Harmless] Could not find emmVRC Config file."); } yield break; }