From a0fda7acff2fbf6586cb3b0d18df70c51a751007 Mon Sep 17 00:00:00 2001 From: Stefan Richter <o-s-r1993@web.de> Date: Sun, 12 Mar 2023 01:46:58 +0100 Subject: [PATCH] AutoOS und AutoSettingsAdaption Bug fixes --- .../Scripts/UI/NetwMenue/StartMenue_mobile.cs | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/Assets/Scripts/UI/NetwMenue/StartMenue_mobile.cs b/Assets/Scripts/UI/NetwMenue/StartMenue_mobile.cs index 3deb88cb..c5201a09 100644 --- a/Assets/Scripts/UI/NetwMenue/StartMenue_mobile.cs +++ b/Assets/Scripts/UI/NetwMenue/StartMenue_mobile.cs @@ -35,7 +35,6 @@ private void Awake() ScreenOptimization(); toChild1(); - if (checkOperationSystemAlreadyDone == false || checkOperationSystemAlreadyDone_check == false) { start2_CheckOS_CheckConfig(); @@ -70,9 +69,13 @@ void start2_CheckOS_CheckConfig() { //Debug.Log("initialReset_PDP"); ResetPersistentDataPath(); + checkOS(); changeSettingsToOS(); NetworkJSON_Save(); } + //Save CheckOS + NetworkJSON_Save(); + if (autoSettingsAdaption) { changeSettingsToOS(); @@ -118,22 +121,29 @@ void checkOS() void checkOS2() { //https://docs.unity3d.com/ScriptReference/RuntimePlatform.html + + if (Application.platform == RuntimePlatform.WindowsPlayer) { - Debug.Log("Windows OS detected"); + //Debug.Log("Windows OS detected"); CommunicationEvents.Opsys = OperationSystem.Windows; return; } if (Application.platform == RuntimePlatform.Android) { - Debug.Log("Android OS detected"); - CommunicationEvents.Opsys = OperationSystem.Windows; + //Debug.Log("Android OS detected"); + CommunicationEvents.Opsys = OperationSystem.Android; return; } - + if (Application.platform == RuntimePlatform.WindowsEditor) + { + CommunicationEvents.Opsys = OperationSystem.Windows; + return; + } + Debug.Log("Detecting OS: " + Application.platform + " -> " + CommunicationEvents.Opsys); //Default: //CommunicationEvents.Opsys = CommunicationEvents.Opsys_Default; -- GitLab