Make the exit button in the menu hide if it can't be used there

This commit is contained in:
2025-06-02 16:43:07 -07:00
parent 022bd45f39
commit 7dfffb0406

View File

@@ -7,9 +7,16 @@ public class MenuScript : MonoBehaviour
void Awake() void Awake()
{ {
exitButton.onClick.AddListener(() => if (!Application.isMobilePlatform || Application.isEditor || Application.platform == RuntimePlatform.WebGLPlayer)
{ {
Application.Quit(); exitButton.gameObject.SetActive(false);
}); }
else
{
exitButton.onClick.AddListener(() =>
{
Application.Quit();
});
}
} }
} }