Browse Source

Merge branch 'F/20230705_Init' of https://gogs.ghz-tech.com:8843/GHzGlass/GHZMRSupportXR into F/20230705_Init

# Conflicts:
#	Assets/Remote/Scenes/Remote3.0.unity
胡佳骏 1 year ago
parent
commit
fa581f5e41

+ 92 - 25
Assets/AgoraVideoAudioManager.cs

@@ -173,19 +173,18 @@ public class AgoraVideoAudioManager : SingletonMono<AgoraVideoAudioManager>
 
         // RtcEngine.DisableAudio();
         //  RtcEngine.DisableVideo();
-     //   VideoEncoderConfiguration config = new VideoEncoderConfiguration();
-        //config.dimensions = new VideoDimensions(1280, 720);
+        VideoEncoderConfiguration config = new VideoEncoderConfiguration();
+        //config.dimensions = new VideoDimensions(CustomInfo.mWidth, CustomInfo.mHight);
         //config.frameRate = 15;
         //config.bitrate = 0;
         //    config.orientationMode = ORIENTATION_MODE.ORIENTATION_MODE_ADAPTIVE;
-      //  RtcEngine.SetVideoEncoderConfiguration(config);
+        //RtcEngine.SetVideoEncoderConfiguration(config);
         RtcEngine.SetChannelProfile(CHANNEL_PROFILE_TYPE.CHANNEL_PROFILE_COMMUNICATION);
         RtcEngine.SetClientRole(CLIENT_ROLE_TYPE.CLIENT_ROLE_BROADCASTER);
         // _channelName = roomid;
         SenderOptions s = new SenderOptions();
-        s.targetBitrate = 1000;
         RtcEngine.SetExternalVideoSource(true, true, EXTERNAL_VIDEO_SOURCE_TYPE.VIDEO_FRAME,s);
-        RtcEngine.SetRemoteDefaultVideoStreamType(VIDEO_STREAM_TYPE.VIDEO_STREAM_LOW);
+        //RtcEngine.SetRemoteDefaultVideoStreamType(VIDEO_STREAM_TYPE.VIDEO_STREAM_LOW);
         if (DeviceType.type == "DreamGlass")
             RtcEngine.SetAudioProfile(0, AUDIO_SCENARIO_TYPE.AUDIO_SCENARIO_GAME_STREAMING);
         //  RtcEngine.SetLocalVideoMirrorMode(VIDEO_MIRROR_MODE_TYPE.VIDEO_MIRROR_MODE_ENABLED);
@@ -199,7 +198,6 @@ public class AgoraVideoAudioManager : SingletonMono<AgoraVideoAudioManager>
         EnableLoacalAudio(CustomInfo.isSendAudio);
         EnableLocalVideo(CustomInfo.isSendVideo);
         isSendVideo = CustomInfo.isSendVideo;
-          StartCoroutine(RenderTexturesScreenCapture());
     }
 
     public void OpenAgoraAudio()
@@ -224,7 +222,7 @@ public class AgoraVideoAudioManager : SingletonMono<AgoraVideoAudioManager>
             screenShot = new Texture2D(CustomInfo.mWidth, CustomInfo.mHight, TextureFormat.RGBA32, false);
             StartCoroutine(GetRenederFPS());
         }
-        while (true)
+        while (screenShot!=null)
         {
            // if (isSendVideo)
            //     continue;
@@ -258,26 +256,30 @@ public class AgoraVideoAudioManager : SingletonMono<AgoraVideoAudioManager>
     byte[] bts;
     IEnumerator GetRenederFPS()
     {
-        while (true)
+        while (screenShot != null)
         {
-            var req = AsyncGPUReadback.Request(RemoteRtc.Instance.cam2.activeTexture);
+            var req = AsyncGPUReadback.Request(RemoteRtc.Instance.cam2.targetTexture);
             yield return new WaitUntil(() => req.done);
-            if (!req.hasError)
+            if(screenShot!=null)
             {
 
-                if (bts == null)
+                if (!req.hasError)
                 {
-                    bts = new byte[req.layerDataSize];
+
+                    if (bts == null)
+                    {
+                        bts = new byte[req.layerDataSize];
+                    }
+                    req.GetData<byte>().CopyTo(bts);
+                    //   screenShot.LoadRawTextureData(bts);
+                    //  screenShot.Apply();
+                    //  tex.SetPixels32(req.GetData<Color32>().ToArray());
+                    //  img.texture = screenShot;
+                }
+                else
+                {
+                    Debug.LogError("Error AsyncGPUReadbackRequest.hasError");
                 }
-                req.GetData<byte>().CopyTo(bts);
-             //   screenShot.LoadRawTextureData(bts);
-              //  screenShot.Apply();
-                //  tex.SetPixels32(req.GetData<Color32>().ToArray());
-              //  img.texture = screenShot;
-            }
-            else
-            {
-                Debug.LogError("Error AsyncGPUReadbackRequest.hasError");
             }
         }
     }
@@ -292,6 +294,7 @@ public class AgoraVideoAudioManager : SingletonMono<AgoraVideoAudioManager>
 
     public void LeaveChannel()
     {
+        cameraStop();
         Debug.Log("LeaveChannel ");
         int msg = RtcEngine.LeaveChannel();
         switch (msg)
@@ -342,7 +345,12 @@ public class AgoraVideoAudioManager : SingletonMono<AgoraVideoAudioManager>
         Debug.Log(" AddPeeridUid " + peerid + "   " + uid);
 
         if (dicPeeridAndUid.ContainsKey(peerid))
+        {
+            dicPeeridAndUid[peerid] = uid;
+
             return;
+
+        }
         dicPeeridAndUid.Add(peerid, uid);
     }
 
@@ -352,7 +360,11 @@ public class AgoraVideoAudioManager : SingletonMono<AgoraVideoAudioManager>
         Debug.Log(" AddPeeridUid " + peerid + "   " + uid);
 
         if (dicPeeridAndUid.ContainsKey(peerid))
+        {
+
+            dicPeeridAndUid[peerid] = uid;
             return;
+        }
         dicPeeridAndUid.Add(peerid, uid);
     }
 
@@ -368,7 +380,10 @@ public class AgoraVideoAudioManager : SingletonMono<AgoraVideoAudioManager>
         for (int i = 0; i < listCustomPeer.Count; i++)
         {
             if (listCustomPeer[i].peerId == peerid)
+            {
                 listCustomPeer.RemoveAt(i);
+                break;
+            }
         }
     }
 
@@ -461,9 +476,39 @@ public class AgoraVideoAudioManager : SingletonMono<AgoraVideoAudioManager>
                 break;
         }
     }
+    public void  cameraStart()
+    {
+        if (rc == null)
+        {
+            if (RemoteRtc.Instance.cam2.targetTexture != null)
+                RemoteRtc.Instance.cam2.targetTexture.Release();
+            RemoteRtc.Instance.cam2.targetTexture = new RenderTexture(CustomInfo.mWidth, CustomInfo.mHight, 1);
+            StartCoroutine(RenderTexturesScreenCapture());
+            XRRGBCamera.Instance.playCamera(CustomInfo.mWidth, CustomInfo.mHight);
 
+        }
+    }
+    public void cameraStop()
+    {
+        XRRGBCamera.Instance.stopCamera();
+        if (screenShot != null)
+            Destroy(screenShot);
+        screenShot = null;
+        rc = null;
+        bts = null;
+    }
+    Coroutine rc;
     public void EnableLocalVideo(bool isVideo)
     {
+        if(isVideo)
+        {
+            cameraStart();
+        }
+        else
+        {
+            cameraStop();
+        }
+
         int msg = RtcEngine.MuteLocalVideoStream(!isVideo);
         //RtcEngine.EnableVideo();
         //int msg = RtcEngine.EnableLocalVideo(isVideo);
@@ -479,10 +524,13 @@ public class AgoraVideoAudioManager : SingletonMono<AgoraVideoAudioManager>
                 break;
         }
     }
-    public void MuteRemoteAudioStream(string uid, bool isAudio)
+    public void MuteRemoteAudioStream(string peerid, bool isAudio)
     {
-     
-        int msg = RtcEngine.MuteRemoteAudioStream(StringToUint(uid) , !isAudio);
+
+        Debug.Log(peerid);
+        if (!dicPeeridAndUid.ContainsKey(peerid))
+            return;
+        int msg = RtcEngine.MuteRemoteAudioStream(dicPeeridAndUid[peerid], !isAudio);
 
         switch (msg)
         {
@@ -615,7 +663,26 @@ public class AgoraVideoAudioManager : SingletonMono<AgoraVideoAudioManager>
             Debug.Log(listCustomPeer[i].peerId);
             if (dicPeeridAndUid[listCustomPeer[i].peerId] == uid)
             {
-                Debug.Log("RemoteAudioStateChanged   " + 2);
+                switch (state)
+                {
+                    case REMOTE_AUDIO_STATE.REMOTE_AUDIO_STATE_STOPPED:
+                        // listCustomPeer[i].isVideo = false;
+                        break;
+                    case REMOTE_AUDIO_STATE.REMOTE_AUDIO_STATE_STARTING:
+                        listCustomPeer[i].isAudio = true;
+                        break;
+                    case REMOTE_AUDIO_STATE.REMOTE_AUDIO_STATE_DECODING:
+                        listCustomPeer[i].isCloseAudio = false;
+                        break;
+                    case REMOTE_AUDIO_STATE.REMOTE_AUDIO_STATE_FROZEN:
+                        break;
+                    case REMOTE_AUDIO_STATE.REMOTE_AUDIO_STATE_FAILED:
+                        //  listCustomPeer[i].isVideo = false;
+                        break;
+                    default:
+                        break;
+                }
+                Debug.Log("RemoteAudioStateChanged   " + reason);
                 switch (reason)
                 {
                     case REMOTE_AUDIO_STATE_REASON.REMOTE_AUDIO_REASON_INTERNAL:

+ 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;
+        }
+    } 
 
 }

+ 1 - 2
Assets/MediaSoup/RemoteRtc.cs

@@ -33,12 +33,11 @@ public class RemoteRtc : SCRtcManager
             CustomInfo.mWidth = 640;
             CustomInfo.mHight = 360;
         }
-        cam2.targetTexture = new RenderTexture(CustomInfo.mWidth, CustomInfo.mHight,1);
         WSHandler.Rtc.onRtcState += onRtcState;
         DontDestroyOnLoad(this.gameObject);
         Instance = this;
 
-        InitCamera();
+      //  InitCamera();
     }
 
     public void InitCamera()

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


+ 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

+ 18 - 0
Assets/Remote/ShowLogin/TestMVC/LoginDlg.cs

@@ -339,6 +339,24 @@ namespace ShadowStudio.UI
                 CustomInfo.isSendAudio = bool.Parse(sData["data"]["settings"]["mic"].ToString());
                 CustomInfo.isSendVideo = bool.Parse(sData["data"]["settings"]["camera"].ToString());
                 CustomInfo.camIndex = int.Parse(sData["data"]["settings"]["resolution"].ToString());
+
+                switch (CustomInfo.camIndex-1)
+                {
+                    case 0:
+                        CustomInfo.mWidth = 1920;
+                        CustomInfo.mHight = 1080;
+                        break;
+                    case 1:
+
+                        CustomInfo.mWidth = 1280;
+                        CustomInfo.mHight = 720;
+                        break;
+                    case 2:
+
+                        CustomInfo.mWidth = 640;
+                        CustomInfo.mHight = 360;
+                        break;
+                }
                 NetWorkHeaders.GetUserAvater((JsonData aData) =>
                 {
                     NetWorkHeaders.Instance.getNetTexture(aData["data"]["user"][0].ToString(), null, (Texture tex) => {

+ 10 - 0
Assets/Remote/ShowRoom/PeerSamllView.cs

@@ -121,6 +121,7 @@ public class PeerSamllView : BaseView, IPointerEnterHandler, IPointerExitHandler
         mViewTexture.material.mainTexture = texture;
         if (c is PeerConfig)
         {
+            Debug.Log("initinitinitinitinitinit");
             if (this.inviteUserConfig != null)
             {
                 this.inviteUserConfig = null;
@@ -177,6 +178,15 @@ public class PeerSamllView : BaseView, IPointerEnterHandler, IPointerExitHandler
 
             alltime = 30f;
             istime = false;
+            bool isAdd =false;
+            for (int j = 0; j < AgoraVideoAudioManager.Instance.listCustomPeer.Count; j++)
+            {
+                if(AgoraVideoAudioManager.Instance.listCustomPeer[i].peerId == cPeer.peerId)
+                {
+                    isAdd = true;
+                }
+            }
+            if(!isAdd)
             AgoraVideoAudioManager.Instance.listCustomPeer.Add(cPeer);
         }
         else if (c is InviteUserConfig)

+ 1 - 1
Assets/Remote/ShowRoom/RoomFile.cs

@@ -274,7 +274,7 @@ public class RoomFile : RemoteSingleton<RoomFile>
                 {
                     float Valuex = float.Parse(data["data"]["params"]["x"].ToString());
                     float Valuey = float.Parse(data["data"]["params"]["y"].ToString());
-                    RemoteRtc.Instance.webTex.autoFocusPoint = new Vector2(Valuex, 1 - Valuey);
+                    //RemoteRtc.Instance.webTex.autoFocusPoint = new Vector2(Valuex, 1 - Valuey);
                     //TextMesh textMesh = obj.transform.Find("Text").GetComponent<TextMesh>();
                     //textMesh.text = "**" + RemoteRtc.Instance.webTex.autoFocusPoint;
                 }

+ 9 - 25
Assets/Remote/ShowRoom/RoomMain.cs

@@ -143,27 +143,11 @@ public class RoomMain : RemoteSingleton<RoomMain>
         isSendVideo = CustomInfo.isSendVideo;
         isCloseView = CustomInfo.isCloseView;
         
-        if (isSendAudio)
-        {
-            TimerMgr.Instance.CreateTimer(() => {
-                RemoteRtc.Instance.sendMic(true);
-            }, 1f);
-        }
-        if (isSendVideo)
-        {
-            TimerMgr.Instance.CreateTimer(() => {
-                RemoteRtc.Instance.startCamera();
-                RemoteRtc.Instance.sendVideo(true);
-            }, 1f);
-        }
-        else
-        {
-            RemoteRtc.Instance.startCamera();
-            // RemoteRtc.Instance.meshRender.gameObject.SetActive(false);
-        }
+        sendAudio(isSendAudio);
+        sendVideo(isSendAudio);
         //if(isCloseView)
         //{
-            RemoteRtc.Instance.changeViewOpen();
+        RemoteRtc.Instance.changeViewOpen();
          //   isCloseView = false;
         //}
         //else
@@ -266,15 +250,15 @@ public class RoomMain : RemoteSingleton<RoomMain>
     {
         if (PopPeerView.Instance)
         {
-            PopPeerView.Instance.list.position = new Vector3(0, 0, 0);
-            PopPeerView.Instance.list.eulerAngles = new Vector3(0, 0, 0);
             PopPeerView.Instance.list.SetParent(PopPublic.Instance.transform);
+            PopPeerView.Instance.list.localPosition = new Vector3(0, 0, 0);
+            PopPeerView.Instance.list.localEulerAngles = new Vector3(0, 0, 0);
         }
         if (PopUpInfo.Instance)
         {
-            PopUpInfo.Instance.transform.position = new Vector3(0, 0, 0);
-            PopUpInfo.Instance.transform.eulerAngles = new Vector3(0, 0, 0);
             PopUpInfo.Instance.transform.SetParent(PopPublic.Instance.transform);
+            PopUpInfo.Instance.transform.localPosition = new Vector3(0, 0, 0);
+            PopUpInfo.Instance.transform.localEulerAngles = new Vector3(0, 0, 0);
         }
         //sendAudio(false);
         //sendVideo(false);
@@ -308,8 +292,8 @@ public class RoomMain : RemoteSingleton<RoomMain>
         if (ShowRoom.Instance)
         {
             ShowRoom.Instance.ShowMainScreen();
-            ShowRoom.Instance.transform.position = new Vector3(0, 0, 0);
-            ShowRoom.Instance.transform.eulerAngles = new Vector3(0, 0, 0);
+            ShowRoom.Instance.transform.localPosition = new Vector3(0, 0, 0);
+            ShowRoom.Instance.transform.localEulerAngles = new Vector3(0, 0, 0);
         }
         if (GameStart.Instance && GameStart.Instance.systemMenu)
         {

+ 1 - 1
Assets/Remote/ShowRoom/RoomMain.prefab

@@ -2757,7 +2757,7 @@ MonoBehaviour:
   m_FallbackScreenDPI: 96
   m_DefaultSpriteDPI: 96
   m_DynamicPixelsPerUnit: 1
-  m_PresetInfoIsWorld: 0
+  m_PresetInfoIsWorld: 1
 --- !u!114 &5666940668507655411
 MonoBehaviour:
   m_ObjectHideFlags: 0

+ 17 - 0
Assets/Remote/ShowRoom/SysSizeView.cs

@@ -20,6 +20,23 @@ public class SysSizeView : BaseView
 
     public void chooseView()
     {
+        switch(viewIndex)
+        {
+            case 0:
+                CustomInfo.mWidth = 1920;
+                CustomInfo.mHight = 1080;
+                break;
+            case 1:
+
+                CustomInfo.mWidth = 1280;
+                CustomInfo.mHight = 720;
+                break;
+            case 2:
+
+                CustomInfo.mWidth = 640;
+                CustomInfo.mHight = 360;
+                break;
+        }
         CustomInfo.camIndex = viewIndex + 1;
         baselist.updateConfig(CustomInfo.sscList);
     }

+ 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

+ 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