Browse Source

兼容ios

“hujiajun” 1 year ago
parent
commit
6cff9874ca

+ 3 - 3
Runtime/SDK/Common/Base/Log/DebugMy.cs

@@ -30,14 +30,14 @@ namespace SC.XR.Unity {
             Tag = "[ SDK:"+ SdkVersion + " ][ FrameCount:" + Time.frameCount + " ]";
 
             if(o == null) {
-                if(Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.WindowsEditor) {
+                if(Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.WindowsEditor || Application.platform == RuntimePlatform.OSXEditor || Application.platform == RuntimePlatform.IPhonePlayer) {
                     Debug.Log(Tag + msg);
                 } else {
                     Console.WriteLine(Tag + msg);
                 }
             } else {
-                if(Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.WindowsEditor) {
-                    //Debug.Log(Tag + "[" + o.GetType().ToString() + "]: " + msg);
+                if(Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.WindowsEditor || Application.platform == RuntimePlatform.OSXEditor || Application.platform == RuntimePlatform.IPhonePlayer) {
+                    Debug.Log(Tag + "[" + o.GetType().ToString() + "]: " + msg);
                 } else {
                     Console.WriteLine(Tag + "[" + o.GetType().ToString() + "]: " + msg);
                 }

+ 3 - 31
Runtime/SDK/Modules/Module_DetectorSystem/SCBatteryDetector/Scripts/DetectorScripts/DeviceStatusDetector.cs

@@ -84,7 +84,7 @@ namespace SC.XR.Unity.Module_DetectorSystem
 
 
         #region Deveice status
-#if UNITY_EDITOR
+
         public int Head_Battery => SCBatteryDetector.getInstance.Head_Battery;
         bool Head_ChargingState => SCBatteryDetector.getInstance.Head_ChargingState;
         // bool Handler_Left_ConState => SCBatteryDetector.getInstance.Handler_Left_ConState;
@@ -109,31 +109,6 @@ namespace SC.XR.Unity.Module_DetectorSystem
                 return handler_right_C;
             }
         }
-#elif UNITY_ANDROID
-        public int Head_Battery => API_Module_BatteryStatus.BatteryLevel;
-        bool Head_ChargingState => API_Module_BatteryStatus.IsCharging == BATTERYSTATUS.BATTERY_STATUS_CHARGING;
-        // handler con
-        bool Handler_Left_ConState
-        {
-            get
-            {
-                handler_left_C = GSXR_Get_ControllerisVaild(GCType.Left) || GSXR_Is_Connected(GCType.Left);
-                if (!handler_left_C)
-                    L_firstOut = false;
-                return handler_left_C;
-            }
-        }
-        bool Handler_Right_ConState
-        {
-            get
-            {
-                handler_right_C = GSXR_Get_ControllerisVaild(GCType.Right) || GSXR_Is_Connected(GCType.Right);
-                if (!handler_right_C)
-                    R_firstOut = false;
-                return handler_right_C;
-            }
-        }   
-#endif
         bool handler_right_C = false;
         bool handler_left_C = false;
         // handler low power
@@ -174,13 +149,10 @@ namespace SC.XR.Unity.Module_DetectorSystem
 
         // >> Handler Battery <<
         int UnderBattery = 15;
-#if UNITY_EDITOR
+ 
         int Handler_Left_Battery => SCBatteryDetector.getInstance.Handler_Left_Battery;
         int Handler_Right_Battery => SCBatteryDetector.getInstance.Handler_Right_Battery;
-#elif UNITY_ANDROID
-        int Handler_Left_Battery => BatteryLevelToPercentage(GCType.Left);
-        int Handler_Right_Battery => BatteryLevelToPercentage(GCType.Right);
-#endif
+   
         HandlerFullBatteryLevelConfig _batteryConfigs;
         HandlerFullBatteryLevelConfig BatteryConfigs
         {

+ 3 - 2
Runtime/SDK/Modules/Module_InputControl/Scripts/ControlTransform.cs

@@ -20,8 +20,8 @@ namespace SC.XR.Unity
         // Update is called once per frame
         void Update()
         {
-
-            if (Application.platform == RuntimePlatform.Android)
+#if UNITY_EDITOR
+            if (Application.platform == RuntimePlatform.Android|| Application.platform == RuntimePlatform.IPhonePlayer)
                 return;
 
             if (Input.GetKey(KeyCode.W))
@@ -54,6 +54,7 @@ namespace SC.XR.Unity
                 transform.position = positionReset;
                 transform.eulerAngles = eulerAnglesReset;
             }
+#endif
         }
     }
 }

+ 1 - 1
Runtime/SDK/Modules/Module_Slam/Scripts/GSXRPlugin.cs

@@ -22,7 +22,7 @@ public abstract class GSXRPlugin
                 } else if (!Application.isEditor && Application.platform == RuntimePlatform.Android) {
                     instance = GSXRPluginAndroid.Create();
                 } else {
-                    instance = GSXRPluginOther.Create();
+                    instance = GSXRPluginWin.Create();
                 }
 			}
 			return instance;

+ 1 - 1
Runtime/SDK/MonoSingleton.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 2310ddcbf6e76cb4394723ffd0b1f2b8
+guid: acb47bfc05c7a42ffabe876d84f1cbd7
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

+ 1 - 1
Runtime/SDK/Singleton.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 4a1ba0246edcfe040830a627c898e0d2
+guid: 4df514b6b42aa40f28bdfe7fc23bb1c2
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2