Browse Source

添加大Gateway

胡佳骏 1 year ago
parent
commit
a7a2cc78f9

+ 3 - 0
Assets/MediaSoup/NetWorkHeaders.cs

@@ -237,6 +237,7 @@ public class NetWorkHeaders : MonoBehaviour
     /// <param name="failed"></param>
     public static void Login(string account, string password, Action<JsonData> success = null, Action<string> failed = null)
     {
+        HttpSDKAction.Instance.check(account);
         JsonData jsdata = new JsonData();
         jsdata["action"] = "/account/login";
         jsdata["account"] = account;
@@ -257,6 +258,7 @@ public class NetWorkHeaders : MonoBehaviour
     /// <param name="failed"></param>
     public static void YuLogin(string account, string password, Action<JsonData> success = null, Action<string> failed = null)
     {
+        HttpSDKAction.Instance.check(account);
         JsonData jsdata = new JsonData();
         jsdata["action"] = "/account/advance";
         jsdata["account"] = account;
@@ -273,6 +275,7 @@ public class NetWorkHeaders : MonoBehaviour
     /// <param name="failed"></param>
     public static void YuLogin(string account, string password, string captcha, string captchaId, Action<JsonData> success = null, Action<string> failed = null)
     {
+        HttpSDKAction.Instance.check(account);
         JsonData jsdata = new JsonData();
         jsdata["action"] = "/account/advance";
         jsdata["Account"] = account;

+ 31 - 4
Assets/MediaSoup/NetWorkHeadersConfig.cs

@@ -19,11 +19,38 @@ public class NetWorkHeadersConfig
     //public const string Remote_Net_url = "https://webapi.shadowcreator.com/100032";
     //public const string Remote_SocketHall_url = "wss://cloud-assistant.shadowcreator.com/lobby?";
     //public const string Remote_SocketRtc_url = "wss://cloud-assistant.shadowcreator.com/room?";
-
-    public const string Remote_Net_url = "https://support.ghz-tech.com:8843/api/";
+    public static string Remote_Net_url 	{
+        get { 
+            if(HttpSDKAction.Instance.loginUrl=="")
+            {
+                HttpSDKAction.Instance.loginUrl = "https://support.ghz-tech.com:8843/api/";
+            }
+            return HttpSDKAction.Instance.loginUrl; }
+	}
+  //  public const string Remote_Net_url = "https://support.ghz-tech.com:8843/api/";
     //public const string Remote_SocketHall_url = "wss://api-cs.ghz-tech.com/remote-lobby/?";
     //public const string Remote_SocketRtc_url = "wss://api-cs.ghz-tech.com/remote-room/?";
-    public const string Remote_SocketHall_url = "wss://support.ghz-tech.com:8843/lobby/?";
-    public const string Remote_SocketRtc_url = "wss://support.ghz-tech.com:8843/room/?";
+    public static string Remote_SocketHall_url
+    {
+        get
+        {
+            if (HttpSDKAction.Instance.officeSocket == "")
+            {
+                HttpSDKAction.Instance.officeSocket = "wss://support.ghz-tech.com:8843/lobby/?";
+            }
+            return HttpSDKAction.Instance.officeSocket;
+        }
+    }
+    public static string Remote_SocketRtc_url
+    {
+        get
+        {
+            if (HttpSDKAction.Instance.roomSocket == "")
+            {
+                HttpSDKAction.Instance.roomSocket = "wss://support.ghz-tech.com:8843/room/?";
+            }
+            return HttpSDKAction.Instance.roomSocket;
+        }
+    } 
 
 }

File diff suppressed because it is too large
+ 113 - 117
Assets/Remote/PopPublic/PDFViewer.prefab


+ 12 - 2
Assets/Remote/Scenes/Remote3.0.unity

@@ -796,7 +796,7 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 0}
   m_AnchorMax: {x: 0, y: 0}
-  m_AnchoredPosition: {x: 0, y: 0}
+  m_AnchoredPosition: {x: 0, y: 1.6}
   m_SizeDelta: {x: 100, y: 100}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!114 &760973018
@@ -1907,7 +1907,7 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 0}
   m_AnchorMax: {x: 0, y: 0}
-  m_AnchoredPosition: {x: 0, y: 0}
+  m_AnchoredPosition: {x: 0, y: 1.6}
   m_SizeDelta: {x: 100, y: 100}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!114 &973110132107938480
@@ -1993,6 +1993,16 @@ PrefabInstance:
       propertyPath: debugInEditor
       value: 0
       objectReference: {fileID: 0}
+    - target: {fileID: 4181028404793140005, guid: 7cd0ceba7525bdc42a36be841a8aad16,
+        type: 3}
+      propertyPath: m_TrackingStateInput.m_Action.m_Name
+      value: Tracking State Input
+      objectReference: {fileID: 0}
+    - target: {fileID: 4181028404793140007, guid: 7cd0ceba7525bdc42a36be841a8aad16,
+        type: 3}
+      propertyPath: m_CullingMask.m_Bits
+      value: 511
+      objectReference: {fileID: 0}
     - target: {fileID: 8475401995549084109, guid: 7cd0ceba7525bdc42a36be841a8aad16,
         type: 3}
       propertyPath: m_RootOrder

+ 1 - 0
Assets/Remote/ShowLogin/LoginInit.prefab

@@ -200,6 +200,7 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 0f598b23cfff18a478f950c4e19fb0df, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  version: {fileID: 4214644005724719402}
 --- !u!1 &4214644006569394024
 GameObject:
   m_ObjectHideFlags: 0

+ 3 - 1
Assets/Remote/Z_Blend/LoginInit.cs

@@ -3,6 +3,7 @@ using System;
 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
+using UnityEngine.UI;
 using XRTool.Util;
 using static ScenesManager;
 using static ShowLogin;
@@ -10,9 +11,10 @@ using static ShowLogin;
 public class LoginInit : MonoBehaviour
 {
     public static string LoginMethod = "";
-
+    public Text version;
     private void Start()
     {
+        version.text = "V " + Application.version;
 #if UNITY_EDITOR
         Invoke("showAccountDlg",1f);
 #endif

+ 14 - 0
Assets/VersionSdk.cs

@@ -0,0 +1,14 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class VersionSdk : MonoBehaviour
+{
+    // Start is called before the first frame update
+    void Start()
+    {
+        this.GetComponent<Text>().text ="V "+ Application.version;
+    }
+
+}

+ 11 - 0
Assets/VersionSdk.cs.meta

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

+ 4 - 3
Assets/XRToolkit/ArtShow/Resources/Container/ModelContainer.prefab

@@ -872,6 +872,7 @@ MonoBehaviour:
   artType: 1
   smoothTween: 3
   ChooseKuang: {fileID: 3461705295923618914}
+  Icon: {fileID: 6611000693616827970}
   offset: {x: 0.02, y: 0.02, z: 0.02}
 --- !u!114 &463633449772349043
 MonoBehaviour:
@@ -900,7 +901,7 @@ BoxCollider:
   m_IsTrigger: 0
   m_Enabled: 1
   serializedVersion: 2
-  m_Size: {x: 1, y: 1, z: 1}
+  m_Size: {x: 0.25, y: 0.25, z: 0.01}
   m_Center: {x: 0, y: 0, z: 0}
 --- !u!1 &7921608367376971768
 GameObject:
@@ -1095,7 +1096,7 @@ MonoBehaviour:
   m_FallbackScreenDPI: 96
   m_DefaultSpriteDPI: 96
   m_DynamicPixelsPerUnit: 1
-  m_PresetInfoIsWorld: 0
+  m_PresetInfoIsWorld: 1
 --- !u!114 &69972489372268428
 MonoBehaviour:
   m_ObjectHideFlags: 0
@@ -1156,5 +1157,5 @@ BoxCollider:
   m_IsTrigger: 0
   m_Enabled: 1
   serializedVersion: 2
-  m_Size: {x: 0.25, y: 0.25, z: 0.25}
+  m_Size: {x: 0.25, y: 0.25, z: 0.01}
   m_Center: {x: 0, y: 0, z: 0}

+ 76 - 17
Assets/XRToolkit/ArtShow/Scripts/Art/ArtHandler.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Collections;
 using System.Collections.Generic;
+using TriLibCore;
 using UnityEngine;
 using XRTool.Util;
 
@@ -288,33 +289,91 @@ namespace ShadowStudio.Model
             {
                 if (IsNeedLoad())
                 {
-                    LoadArtAsyn("", container.UpdateProcess, (obj) =>
+                    if(container is ModelContainer)
                     {
-                        if (IsNeedInstance())
-                        {
-                            obj = InstanceArt();
-                        }
-                        if (obj is GameObject)
-                        {
-                            if (!(obj as GameObject).activeSelf)
+                        bool isLoaded=false;
+                        AssetLoaderContext asc = null;
+                        TriLibModelLoad.Load(info.Url, (AssetLoaderContext ac) => {
+                            isLoaded = true;
+                            Debug.Log("模型加载完成");
+                            ChangeLayerRecursively(ac.RootGameObject.transform);
+                            container.AddToContainer(ac.RootGameObject, info);
+                            var artComponent = InstanceComponent();
+                            container.AddArtComponent(artComponent);
+                            if (artComponent != null)
+                            {
+                                artComponent.SetContainer(container as ArtContainerHandler, ac.RootGameObject, info);
+                            }
+                        }, (AssetLoaderContext ac) => {
+                            Debug.Log("载材质加完成");
+
+                        }, (AssetLoaderContext ac, float f) => {
+                            asc = ac;
+                            container.UpdateProcess(f);
+                            Debug.Log("开始加载 ParseModel_Coroutine" + f);
+                        }, (IContextualizedError error) => {
+                            isLoaded = true;
+                        }, (container as ModelContainer).ModelRoot.gameObject);
+                        Timer t = null;
+                        t =  TimerMgr.Instance.CreateTimer(()=> {
+                            if(!isLoaded&& container!=null&& (container as ModelContainer).ModelRoot!=null)
                             {
-                                (obj as GameObject).SetActive(true);
+                                (container as ModelContainer).CalculateRendererBounds(true);
+                                ChangeLayerRecursively((container as ModelContainer).ModelRoot);
                             }
-                        }
-                        container.AddToContainer(obj, info);
-                        var artComponent = InstanceComponent();
-                        container.AddArtComponent(artComponent);
-                        if (artComponent != null)
+                            else
+                            {
+                                TimerMgr.Instance.DestroyTimer(t);
+                            }
+                        },1,-1);
+                    }
+                    else
+                    {
+
+                        LoadArtAsyn("", container.UpdateProcess, (obj) =>
                         {
-                            artComponent.SetContainer(container as ArtContainerHandler, obj, info);
-                        }
-                    });
+                            if (IsNeedInstance())
+                            {
+                                 obj = InstanceArt();
+                            }
+                            if (obj is GameObject)
+                            {
+                                if (!(obj as GameObject).activeSelf)
+                                {
+                                    (obj as GameObject).SetActive(true);
+                                }
+                            }
+                            container.AddToContainer(obj, info);
+                            var artComponent = InstanceComponent();
+                            container.AddArtComponent(artComponent);
+                            if (artComponent != null)
+                            {
+                                artComponent.SetContainer(container as ArtContainerHandler, obj, info);
+                            }
+                        });
+                    }
                 }
             }
 
             container.SetArtHandler(this);
             OnCreateArt?.Invoke(ArtDisPlay);
             return container;
+        }    
+        /// <summary>
+            ///  更改层级
+            /// </summary>
+            /// <param name="parentTransform"></param>
+        public void ChangeLayerRecursively(Transform parentTransform)
+        {
+            // 修改父物体的层级
+            parentTransform.gameObject.layer = LayerMask.NameToLayer("Arrow");
+
+            // 遍历所有子物体,并递归调用ChangeLayerRecursively方法
+            for (int i = 0; i < parentTransform.childCount; i++)
+            {
+                Transform childTransform = parentTransform.GetChild(i);
+                ChangeLayerRecursively(childTransform);
+            }
         }
         /// <summary>
         /// 异步创建容器

+ 12 - 4
Assets/XRToolkit/ArtShow/Scripts/Container/ModelContainer.cs

@@ -19,6 +19,7 @@ namespace ShadowStudio.Model
     public class ModelContainer : GoodsContainer
     {
         public GameObject ChooseKuang;
+        public GameObject Icon;
         private BoxCollider colliderBody;
         private Transform modelRoot;
         //private NearInterationGrabbable nearInteration;
@@ -94,15 +95,19 @@ namespace ShadowStudio.Model
             }
         }
 
-        public void CalculateRendererBounds()
+        public void CalculateRendererBounds(bool isLoading=false)
         {
             if (ModelRoot.childCount < 1)
             {
                 DownInfo.SetActive(true);
                 return;
             }
-            DownInfo.SetActive(false);
-            ChooseKuang.SetActive(false);
+            if(!isLoading)
+            {
+                DownInfo.SetActive(false);
+                ChooseKuang.SetActive(false);
+            }
+            Icon.SetActive(false);
             //transform.DOKill(true);
             if (ModelRenderers == null || ModelRenderers.Length < 1)
                 ModelRenderers = ModelRoot.GetComponentsInChildren<Renderer>();
@@ -170,7 +175,10 @@ namespace ShadowStudio.Model
             transform.position = curPos;
             transform.rotation = curRot;
             transform.localScale = curScale;
-            Transfer.RemoveBound();
+            if (!isLoading)
+            {
+                Transfer.RemoveBound();
+            }
             //PlayEffect();
             //TimerMgr.Instance.CreateTimer(() =>
             //{

+ 6 - 3
Assets/XRToolkit/ArtShow/Scripts/Handler/ExtralLoadHandler.cs

@@ -244,15 +244,18 @@ namespace ShadowStudio.Model
                 artState = ArtState.Loaded;
 
             }, (AssetLoaderContext ac, float f) => {
-
-                Debug.Log("加载中==》" + f);
+                if (ac.RootGameObject)
+                {
+                    Debug.Log("加载中=111111111111111111=》" + f);
+                }
+                Debug.Log("开始加载 ParseModel_Coroutine" + f);
             }, (IContextualizedError error) => {
 
                 loaded?.Invoke(null);
                 artLoaded?.Invoke(null);
                 artState = ArtState.UnLoad;
                 UnityLog.LogError(Info.ArtId + "资源加载失败");
-            });
+            }, (LoadCache as GameObject));
             return;
             //var modelFileWithStream = FindModelFile();
             var modelFilename = Path.GetFileName(filename);

Some files were not shown because too many files changed in this diff