From 2619d05374a8bcabf026351482935eff987f0c39 Mon Sep 17 00:00:00 2001 From: anavoi Date: Sun, 13 Jul 2025 12:09:32 +0200 Subject: [PATCH] fix: vsync toggle --- Addons/GBSUGui.cs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Addons/GBSUGui.cs b/Addons/GBSUGui.cs index 8565f99..44bddc7 100644 --- a/Addons/GBSUGui.cs +++ b/Addons/GBSUGui.cs @@ -25,7 +25,6 @@ public class GBSUGui : MonoBehaviour string serverip = null; int serverport = 5999; string currentmap; - int vsync_switch; bool hosting = false; private void Start() { @@ -37,8 +36,6 @@ public class GBSUGui : MonoBehaviour { int.TryParse(CommandLineParser.Instance.GetValueForKey("-port", true), out serverport); } - - vsync_switch = QualitySettings.vSyncCount; } private void Update() { @@ -159,16 +156,14 @@ Make sure to download a file from the examples given and rename it to config.jso } if (GUI.Button(new Rect(20f, 330f, 170f, 30f), "Toggle VSync")) { - if (vsync_switch == 0) + if (QualitySettings.vSyncCount == 0) { - vsync_switch = 1; + QualitySettings.vSyncCount = 1; } else { - vsync_switch = 0; + QualitySettings.vSyncCount = 0; } - - QualitySettings.vSyncCount = vsync_switch; } GUI.Label(new Rect(20f, 365f, 365f, 400f), $@"