From bec491448089015a1fe4058a60f446f8da064d35 Mon Sep 17 00:00:00 2001 From: Darien Johnson <84008186+CADIndie@users.noreply.github.com> Date: Fri, 9 Aug 2024 08:55:40 -0500 Subject: [PATCH] Fix Editor Debugging --- Assets/Scripts/DesktopCam.cs | 2 +- Assets/Scripts/DownloadTextManager.cs | 2 +- Assets/Scripts/InstanceButton.cs | 2 +- Assets/Scripts/JNIStorage.cs | 5 +++-- Assets/Scripts/LoginHandler.cs | 4 ++-- Assets/Scripts/LoginText.cs | 2 +- Assets/Scripts/UiRedocker.cs | 8 ++------ 7 files changed, 11 insertions(+), 14 deletions(-) diff --git a/Assets/Scripts/DesktopCam.cs b/Assets/Scripts/DesktopCam.cs index 73a6d3ae..885b1b9c 100644 --- a/Assets/Scripts/DesktopCam.cs +++ b/Assets/Scripts/DesktopCam.cs @@ -8,7 +8,7 @@ public class DesktopCam : MonoBehaviour // Start is called before the first frame update void Start() { - if (Application.platform != RuntimePlatform.WindowsEditor) + if (Application.platform == RuntimePlatform.Android) return; VrCam.SetActive(false); diff --git a/Assets/Scripts/DownloadTextManager.cs b/Assets/Scripts/DownloadTextManager.cs index 33da1e86..8bd7fe7b 100644 --- a/Assets/Scripts/DownloadTextManager.cs +++ b/Assets/Scripts/DownloadTextManager.cs @@ -9,7 +9,7 @@ public class DownloadTextManager : MonoBehaviour // Update is called once per frame void Update() { - if (Application.platform == RuntimePlatform.WindowsEditor) + if (Application.platform != RuntimePlatform.Android) return; string currentFile = JNIStorage.apiClass.GetStatic("currentDownload"); double mbDownloaded = TruncateDouble(JNIStorage.apiClass.GetStatic("downloadStatus"), 3); diff --git a/Assets/Scripts/InstanceButton.cs b/Assets/Scripts/InstanceButton.cs index 8c2ce7d2..8a59a4b3 100644 --- a/Assets/Scripts/InstanceButton.cs +++ b/Assets/Scripts/InstanceButton.cs @@ -11,7 +11,7 @@ public class InstanceButton : MonoBehaviour private void Update() { - if (Application.platform == RuntimePlatform.WindowsEditor) + if (Application.platform != RuntimePlatform.Android) return; currInstName = JNIStorage.instance.instancesDropdown.options[JNIStorage.instance.instancesDropdown.value].text; } diff --git a/Assets/Scripts/JNIStorage.cs b/Assets/Scripts/JNIStorage.cs index 616f2bcd..ea40a9f5 100644 --- a/Assets/Scripts/JNIStorage.cs +++ b/Assets/Scripts/JNIStorage.cs @@ -14,7 +14,7 @@ public class JNIStorage : MonoBehaviour public List supportedVersions; public UIHandler uiHandler; public TMP_Dropdown instancesDropdown; - private ConfigHandler configHandler; + public ConfigHandler configHandler; private void Start() { @@ -30,7 +30,7 @@ private void Start() instancesObj = apiClass.CallStatic("loadAll"); configHandler.LoadConfig(); UpdateInstances(); - apiClass.SetStatic("model", OpenXRFeatureSystemInfo.GetHeadsetName()); + //apiClass.SetStatic("model", OpenXRFeatureSystemInfo.GetHeadsetName()); } private static void FillSupportedVersions(List supportedVersions, string[] supportedVersionsArray) @@ -65,6 +65,7 @@ public static PojlibInstance GetInstance(string name) public void UpdateInstances() { + if (Application.platform != RuntimePlatform.Android) return; AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); activity = jc.GetStatic("currentActivity"); diff --git a/Assets/Scripts/LoginHandler.cs b/Assets/Scripts/LoginHandler.cs index 501c675e..13415bab 100644 --- a/Assets/Scripts/LoginHandler.cs +++ b/Assets/Scripts/LoginHandler.cs @@ -33,7 +33,7 @@ async Task LoadingButtonText() } LoadingButtonText(); - if (Application.platform == RuntimePlatform.WindowsEditor) return; + if (Application.platform != RuntimePlatform.Android) return; if (hasAttemptedLogin) return; javaClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); javaObject = javaClass.GetStatic("currentActivity"); @@ -43,7 +43,7 @@ async Task LoadingButtonText() } private async void CheckVerification() { - if (Application.platform == RuntimePlatform.WindowsEditor) + if (Application.platform != RuntimePlatform.Android) return; while (isMainScreen == false) { diff --git a/Assets/Scripts/LoginText.cs b/Assets/Scripts/LoginText.cs index cf8b6b32..cdc6c168 100644 --- a/Assets/Scripts/LoginText.cs +++ b/Assets/Scripts/LoginText.cs @@ -18,7 +18,7 @@ private void Start() void Update() { string buffer; - if (Application.platform == RuntimePlatform.WindowsEditor) + if (Application.platform != RuntimePlatform.Android) buffer = debugText; else buffer = JNIStorage.apiClass.GetStatic("msaMessage"); diff --git a/Assets/Scripts/UiRedocker.cs b/Assets/Scripts/UiRedocker.cs index bd94f568..d3552a7e 100644 --- a/Assets/Scripts/UiRedocker.cs +++ b/Assets/Scripts/UiRedocker.cs @@ -13,6 +13,8 @@ public class UiRedocker : MonoBehaviour private bool main = true; private void Start() { + if (Application.platform != RuntimePlatform.Android) return; + redockButton.onClick.AddListener(() => { if (main) @@ -22,12 +24,6 @@ private void Start() main = !main; }); - - return; - - GameObject gender; - - Transition(gender); } void Transition(GameObject transitionObject)