Browse Source

添加适配A01的帧率 以及 去除Nreal写死的GameObject 替换为头部

胡佳骏 1 year ago
parent
commit
0e4786993d
2 changed files with 13 additions and 4 deletions
  1. 11 2
      Assets/ImmersalSDK/Core/Scripts/ImmersalSDK.cs
  2. 2 2
      Assets/Scripts/IrobotMove.cs

+ 11 - 2
Assets/ImmersalSDK/Core/Scripts/ImmersalSDK.cs

@@ -192,8 +192,17 @@ namespace Immersal
 		}
 
 		private void SetFrameRate()
-		{
-			Application.targetFrameRate = targetFrameRate;
+        {
+            switch (DeviceType.type)
+            {
+				case "A01":
+					Application.targetFrameRate = 300;
+					break;
+				default:
+					Application.targetFrameRate = targetFrameRate ;
+					break;
+			}
+			
 		}
 
 		private void SetDownsample()

+ 2 - 2
Assets/Scripts/IrobotMove.cs

@@ -22,8 +22,8 @@ public class IrobotMove : MonoBehaviour
 
     private void Start()
     {
-        if (GameObject.Find("NRCameraRig") != null)
-            NRCameraRig = GameObject.Find("NRCameraRig").GetComponent<Transform>();
+        //if (GameObject.Find("NRCameraRig") != null)
+            NRCameraRig = OpenXRCamera.Instance.head;
 
         m_IsWalk = false;
         m_Animator = GetComponent<Animator>();