Web changes

This commit is contained in:
2025-06-06 00:03:00 -07:00
parent 098ff4fb16
commit 7548eebc5b
2 changed files with 10 additions and 3 deletions

View File

@@ -27,12 +27,12 @@ public class LoadingMenu : MonoBehaviour
PlayerPrefs.DeleteKey("HighScore");
}
QualitySettings.vSyncCount = PlayerPrefs.GetInt("Setting3", 1) == 1 ? 1 : -1;
Screen.fullScreen = PlayerPrefs.GetInt("Setting1", 1) == 1;
if (!Application.isMobilePlatform)
if (!Application.isMobilePlatform && Application.platform != RuntimePlatform.WebGLPlayer)
{
SetIfNone("Setting1", 1);
SetIfNone("Setting2", 0);
SetIfNone("Setting3", 1);
Screen.fullScreen = PlayerPrefs.GetInt("Setting1", 1) == 1;
}
else
{
@@ -41,6 +41,9 @@ public class LoadingMenu : MonoBehaviour
SetIfNone("Setting3", 1, true);
Application.targetFrameRate = 360;
QualitySettings.vSyncCount = 0;
if (Application.platform == RuntimePlatform.WebGLPlayer) {
Screen.fullScreen = false;
}
}
PlayerPrefs.SetString("latestVersion", Application.version);
updateButton.onClick.AddListener(() =>

View File

@@ -13,7 +13,7 @@ public class SettingsMenu : MonoBehaviour
{
musicSlider.value = PlayerPrefs.GetFloat("musicVolume", 1f);
sfxSlider.value = PlayerPrefs.GetFloat("sfxVolume", 1f);
if (!Application.isMobilePlatform)
if (!Application.isMobilePlatform && Application.platform != RuntimePlatform.WebGLPlayer)
{
setting1toggle.isOn = PlayerPrefs.GetInt("Setting1", 1) == 1;
setting2toggle.isOn = PlayerPrefs.GetInt("Setting2", 0) == 1;
@@ -24,6 +24,10 @@ public class SettingsMenu : MonoBehaviour
setting1toggle.interactable = false;
setting2toggle.isOn = PlayerPrefs.GetInt("Setting2", 0) == 1;
setting3toggle.interactable = false;
if (Application.platform == RuntimePlatform.WebGLPlayer)
{
setting1toggle.isOn = false;
}
}
setting1toggle.onValueChanged.AddListener(value =>
{