refactor: avoid setting a variable (tracking the current scene) changing its value more often than it can be displayed

This commit is contained in:
anavoi 2025-07-13 12:36:26 +02:00
commit 02361d278d

View file

@ -24,7 +24,6 @@ public class GBSUGui : MonoBehaviour
readonly IInputSystem inputSystem = UnityInput.Current;
string serverip = null;
int serverport = 5999;
string currentmap;
bool hosting = false;
private void Start()
{
@ -44,8 +43,6 @@ public class GBSUGui : MonoBehaviour
//Plugin.Log.LogInfo("Toggling GBSU menu...");
ToggleMenu();
}
currentmap = UnityEngine.SceneManagement.SceneManager.GetActiveScene().name;
}
private void ToggleMenu()
@ -168,7 +165,7 @@ Make sure to download a file from the examples given and rename it to config.jso
GUI.Label(new Rect(20f, 365f, 365f, 400f), $@"
Current map: {currentmap}
Current map: {UnityEngine.SceneManagement.SceneManager.GetActiveScene().name}
Lobby State: {LobbyManager.Instance.LobbyStates.SelfState}
VSync: {QualitySettings.vSyncCount}
Target FPS: {Application.targetFrameRate}