fix: vsync toggle
This commit is contained in:
parent
2e5d5a9942
commit
2619d05374
1 changed files with 3 additions and 8 deletions
|
|
@ -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), $@"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue