فهرست منبع

视频框和 头苗时候的拖拽问题

胡佳骏 1 سال پیش
والد
کامیت
c5c2a3617d

+ 2 - 1
Assets/GHZScritps/AgoraRTCManager.cs

@@ -560,14 +560,15 @@ public class AgoraRTCManager : SingletonMono<AgoraRTCManager>
         // create a GameObject and assign to this new user
         // var videoSurface = MakePlaneSurface(uid.ToString());
         // configure videoSurface
-        rawImage.transform.localEulerAngles = Vector3.zero;
         if (uid == 0)
         {
+            rawImage.transform.localEulerAngles = Vector3.zero;
             //videoSurface.SetForUser(uid, channelId);
             rawImage.texture = AgoraRTCManager.Instance.cam2.activeTexture;
         }
         else
         {
+            rawImage.transform.localEulerAngles = new Vector3(-180,0,0);
             var videoSurface = MakeImageSurface(rawImage);
 
             if (ReferenceEquals(videoSurface, null)) return;

+ 0 - 7
Assets/Plugins/Android/AndroidManifest.xml.meta

@@ -1,7 +0,0 @@
-fileFormatVersion: 2
-guid: 74a338c96fc281044965d1854cd1c348
-TextScriptImporter:
-  externalObjects: {}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 1 - 1
Assets/StreamingAssets/build_info

@@ -1 +1 @@
-Build from YUNYUNGEGE at 2023/7/19 10:29:30
+Build from YUNYUNGEGE at 2023/7/20 12:48:43

+ 9 - 3
Assets/Studio/_3HomeScene/HomeSceneScripts_new/UI/MenuUI.cs

@@ -7,6 +7,7 @@ using UnityEngine.EventSystems;
 using UnityEngine.UI;
 using SC.XR.Unity;
 using XRTool.Util;
+using SC.XR.Unity.Module_InputSystem.InputDeviceHead;
 
 public class MenuUI : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler
 {
@@ -216,13 +217,18 @@ public class MenuUI : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHa
     public void OnDrag(PointerEventData eventData)
     {
         SCPointEventData sed = eventData as SCPointEventData;
+        if(sed.inputDevicePartBase is InputDeviceHeadPart)
+        {
+            sed.inputDevicePartBase.transform.position = OpenXRCamera.Instance.head.position;
+            sed.inputDevicePartBase.transform.eulerAngles = OpenXRCamera.Instance.head.eulerAngles;
+        }
         ob.transform.position = (eventData as SCPointEventData).PressPosition3D;
         float ox = ob.transform.localPosition.x;
         //  return;
         float _delta = (bx - ox)*100;//eventData.delta.x / _maxDragValue;//记录拖动的增量比值(用作速度比值)
         bx = ox;
-     //   Debug.Log("_delta===>"+_delta);
-        if (_delta < -0.01f)//向左拖动时
+        Debug.Log("_delta===>"+_delta);
+        if (_delta < -0.1f)//向左拖动时
         {
            // _delta = -0.5f;
 
@@ -310,7 +316,7 @@ public class MenuUI : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHa
             }
         }
 
-        else if (_delta > 0.01f)//向右拖动时
+        else if (_delta > 0.1f)//向右拖动时
         {
            // _delta = 0.5f;
             _isInLeft = false;

+ 1 - 1
Assets/XR/Settings/OpenXR Package Settings.asset

@@ -557,8 +557,8 @@ MonoBehaviour:
   - {fileID: 4374578020134790284}
   - {fileID: 8531339077439252892}
   - {fileID: -7289267554029602882}
-  - {fileID: 4050226339341564967}
   - {fileID: 539454338071500753}
+  - {fileID: 4050226339341564967}
   - {fileID: -1632232163529381839}
   - {fileID: -122667807680663078}
   - {fileID: 5055189337874793655}

+ 2 - 5
ProjectSettings/ProjectSettings.asset

@@ -153,9 +153,6 @@ PlayerSettings:
   - {fileID: 0}
   - {fileID: 0}
   - {fileID: 0}
-  - {fileID: 11400000, guid: 8cfc4b2ca50477f438d705a8fcd79070, type: 2}
-  - {fileID: 6574215653562748417, guid: 93ed3b462c7c82d4594fa4d925b91911, type: 2}
-  - {fileID: -7757256057747849950, guid: bf1be7b556e14e44aadbe8ccbd6b4a1d, type: 2}
   metroInputSource: 0
   wsaTransparentSwapchain: 0
   m_HolographicPauseOnTrackingLoss: 1
@@ -932,7 +929,7 @@ PlayerSettings:
   metroSplashScreenUseBackgroundColor: 1
   platformCapabilities:
     WindowsStoreApps:
-      CodeGeneration: False
+      EnterpriseAuthentication: False
       OfflineMapsManagement: False
       HumanInterfaceDevice: False
       Location: False
@@ -967,8 +964,8 @@ PlayerSettings:
       Contacts: False
       Proximity: False
       InternetClient: True
+      CodeGeneration: False
       BackgroundMediaPlayback: False
-      EnterpriseAuthentication: False
   metroTargetDeviceFamilies:
     Desktop: False
     Holographic: False