Browse Source

适配手机端

胡佳骏 1 year ago
parent
commit
f68fa1594f

+ 0 - 38
Assets/RefPose.cs

@@ -1,38 +0,0 @@
-using Immersal.AR;
-using NRKernal;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-using XRTool.Util;
-
-public class RefPose : MonoBehaviour
-{
-    public XRLocalizer xrlocal;
-    // Start is called before the first frame update
-    void Start()
-    {
-        
-    }
-
-    public void Ref()
-    {
-        
-        xrlocal.Reset();
-        NRSessionManager.Instance.NRHMDPoseTracker.ChangeTo0Dof((result) =>
-        {
-            TimerMgr.Instance.CreateTimer(() => {
-
-                NRSessionManager.Instance.NRHMDPoseTracker.ChangeTo6Dof((result) =>
-                {
-                    var poseTracker = NRSessionManager.Instance.NRHMDPoseTracker;
-                    poseTracker.ResetWorldMatrix(false);
-                    xrlocal.Reset();
-                    NRInput.RecenterController();
-                });
-
-            }, 1f);
-        });
-    }
-
-
-}

+ 0 - 11
Assets/RefPose.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 87aa69949b9a26e4d9df41806abce773
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 8 - 8
Assets/Resources/UI/SceneChoose2.prefab

@@ -178,7 +178,7 @@ GameObject:
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
-  m_IsActive: 1
+  m_IsActive: 0
 --- !u!224 &4795344182225730044
 RectTransform:
   m_ObjectHideFlags: 0
@@ -348,14 +348,14 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   m_Material: {fileID: 0}
-  m_Color: {r: 1, g: 1, b: 1, a: 1}
+  m_Color: {r: 0.13333334, g: 0.13333334, b: 0.13333334, a: 1}
   m_RaycastTarget: 1
   m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
   m_Maskable: 1
   m_OnCullStateChanged:
     m_PersistentCalls:
       m_Calls: []
-  m_Sprite: {fileID: 21300000, guid: 11aa15ad387ce3547949a1771c5f8c08, type: 3}
+  m_Sprite: {fileID: 0}
   m_Type: 0
   m_PreserveAspect: 0
   m_FillCenter: 1
@@ -417,7 +417,7 @@ RectTransform:
   m_RootOrder: 0
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 0}
-  m_AnchorMax: {x: 0, y: 0}
+  m_AnchorMax: {x: 1, y: 1}
   m_AnchoredPosition: {x: 0, y: 0}
   m_SizeDelta: {x: 20, y: 20}
   m_Pivot: {x: 0.5, y: 0.5}
@@ -519,14 +519,14 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   m_Material: {fileID: 0}
-  m_Color: {r: 1, g: 1, b: 1, a: 1}
+  m_Color: {r: 0.13207549, g: 0.13207549, b: 0.13207549, a: 1}
   m_RaycastTarget: 1
   m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
   m_Maskable: 1
   m_OnCullStateChanged:
     m_PersistentCalls:
       m_Calls: []
-  m_Sprite: {fileID: 21300000, guid: 11aa15ad387ce3547949a1771c5f8c08, type: 3}
+  m_Sprite: {fileID: 0}
   m_Type: 0
   m_PreserveAspect: 0
   m_FillCenter: 1
@@ -677,14 +677,14 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   m_Material: {fileID: 0}
-  m_Color: {r: 1, g: 1, b: 1, a: 1}
+  m_Color: {r: 0.13333334, g: 0.13333334, b: 0.13333334, a: 1}
   m_RaycastTarget: 1
   m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
   m_Maskable: 1
   m_OnCullStateChanged:
     m_PersistentCalls:
       m_Calls: []
-  m_Sprite: {fileID: 21300000, guid: 11aa15ad387ce3547949a1771c5f8c08, type: 3}
+  m_Sprite: {fileID: 0}
   m_Type: 0
   m_PreserveAspect: 0
   m_FillCenter: 1

+ 1 - 1
Assets/Resources/VuforiaConfiguration.asset

@@ -39,7 +39,7 @@ MonoBehaviour:
     unlitShader: {fileID: 10752, guid: 0000000000000000f000000000000000, type: 0}
     videoBackgroundEnabled: 1
   deviceTracker:
-    autoStartTracker: 0
+    autoStartTracker: 1
     arcoreRequirement: 1
     autoImportArcore: 1
     thirdPartyARCoreClientDetected: 1

+ 8 - 1
Assets/Scripts/UI/LoginPanel.cs

@@ -10,6 +10,7 @@ using System.IO;
 using System.Text.RegularExpressions;
 using UnityEngine;
 using UnityEngine.UI;
+using Vuforia;
 
 public class LoginPanel : BaseUI
 {
@@ -456,7 +457,13 @@ public class LoginPanel : BaseUI
        // yield return new WaitForSeconds(times);
         yield return new WaitForFixedUpdate();
         UserManager.Instance.loginBack(true);
-        GameManager.Instance.arcamre.SetActive(true);
+        if (DeviceType.type != "Phone")
+            GameManager.Instance.arcamre.SetActive(true);
+        else
+        {
+            OpenXRCamera.Instance.head.gameObject.AddComponent<VuforiaBehaviour>();
+            OpenXRCamera.Instance.head.gameObject.AddComponent<DefaultInitializationErrorHandler>();
+        }
         GameManager.Instance.immser.SetActive(false);
     }