I'm creating a game in unity and I'm doing the settings page which is either on the main menu and while playing. I have a toggle for enabling vsync and disabling but if the check is checked in the main menu it's not checked while playing so I just created a bool and if it is true I want it to check the toggle and if it false to uncheck it but I don't know how to do it and I didn't find answers. Thank you very much
public void Modifyvsync()
{
if (vsynconoff.isOn)
{
QualitySettings.vSyncCount = 1;
}
else
{
QualitySettings.vSyncCount = 0;
}
PlayerPrefs.SetInt("vsyncount", QualitySettings.vSyncCount);
}
this is a method that I linked to a toggle, but if I get to the play scene and I return back to the settings menu the toggle isn't more checked even if I checked the toggle. I want it to remain checked even after I change scene