From 7dfffb0406a5bc1983704a0d6ec59463acd7fe96 Mon Sep 17 00:00:00 2001 From: Lncvrt Date: Mon, 2 Jun 2025 16:43:07 -0700 Subject: [PATCH] Make the exit button in the menu hide if it can't be used there --- Assets/Scripts/MainMenu.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/MainMenu.cs b/Assets/Scripts/MainMenu.cs index 8bc5959..61c5d94 100644 --- a/Assets/Scripts/MainMenu.cs +++ b/Assets/Scripts/MainMenu.cs @@ -7,9 +7,16 @@ public class MenuScript : MonoBehaviour 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(); + }); + } } }