Browse Source

Merge branch 'F/0710_2.1+2.0' of ssh://gogs.ghz-tech.com:30979/GHzGlass/GHZMRNavigatorProXR into F/0710_2.1+2.0

DGJ 1 year ago
parent
commit
e5a1db8adf

+ 2 - 2
Assets/COS/QCloudCSharpSDK/COSXML/Transfer/TransferManager.cs

@@ -29,12 +29,12 @@ namespace COSXML.Transfer
 
             if (cosXmlServer == null)
             {
-                throw new ArgumentNullException("CosXmlServer = null");
+              //  throw new ArgumentNullException("CosXmlServer = null");
             }
 
             if (transferConfig == null)
             {
-                throw new ArgumentNullException("TransferConfig = null");
+             //   throw new ArgumentNullException("TransferConfig = null");
             }
 
             this.transferConfig = transferConfig;

+ 12 - 7
Assets/COSScripts/COSDownLoad.cs

@@ -116,7 +116,7 @@ public class COSDownLoad:MonoSingleton<COSDownLoad>
         if (jObject["code"].ToString() == "200")
         {
             sceneSuccessCos = JsonConvert.DeserializeObject<SuccessCOS>(jObject["data"].ToString());
-            InitMaterialCos();
+            InitSceneCos();
         }
         else
         {
@@ -192,10 +192,10 @@ public class COSDownLoad:MonoSingleton<COSDownLoad>
 
         // 手动设置高级下载接口的并发数 (默认为5), 从5.4.26版本开始支持!
         //downloadTask.SetMaxTasks(10);
-        //downloadTask.progressCallback = delegate (long completed, long total)
-        //{
-        //    Console.WriteLine(String.Format("progress = {0:##.##}%", completed * 100.0 / total));
-        //};
+        downloadTask.progressCallback = delegate (long completed, long total)
+        {
+            Debug.Log(String.Format("Hjj    download"+downloadMaterial.downLoadPath+"progress = {0:##.##}%", completed * 100.0 / total));
+        };
         Debug.Log(downloadMaterial.downLoadPath);
         downloadTask.onState += OnState;
         listDownLoadTask.Add(downloadTask);
@@ -317,20 +317,25 @@ public class COSDownLoad:MonoSingleton<COSDownLoad>
         Debug.Log(state);
 
         if (state == TaskState.Completed || state == TaskState.Failed)
-            for (int i = 0; i < listDownLoadTask.Count; i++)
+        {
+            int ct = listDownLoadTask.Count - 1;
+            for (int i = ct; i >= 0; i--)
             {
-                Debug.Log(listDownLoadTask.Count + "   "+listDownLoadTask[i].State());
+                
                 if (listDownLoadTask[i].State() == TaskState.Completed)
                 {
+                    Debug.Log(listDownLoadTask.Count + "   " + listDownLoadTask[i].State() + "   " + listDownLoadTask[i].localFileName);
                     DownloadResManager.Instance.DownLoadCompleted(listDownLoadTask[i].localFileName);
                     listDownLoadTask.RemoveAt(i);
                 }
                 if (listDownLoadTask[i].State() == TaskState.Failed)
                 {
+                    Debug.Log(listDownLoadTask.Count + "   " + listDownLoadTask[i].State() + "   " + listDownLoadTask[i].localFileName);
                     DownloadResManager.Instance.DownLoadFaild(listDownLoadTask[i].localFileName);
                     listDownLoadTask.RemoveAt(i);
                 }
             }
+        }
     }
 
 }

+ 4 - 2
Assets/COSScripts/DownloadResManager.cs

@@ -149,7 +149,8 @@ public class DownloadResManager : MonoSingleton<DownloadResManager>
         nowDownLoad--;
         for (int i = 0; i < listNotMaterial.Count; i++)
         {
-            if(Path.GetFileName( listNotMaterial[i].localLoadPath) == localFilePath)
+            Debug.Log("Hjj   DownLoadCompleted :" + listNotMaterial[i].downLoadPath + "——" + localFilePath);
+            if (Path.GetFileName( listNotMaterial[i].downLoadPath) == localFilePath)
             {
                 listCompletedMaterial.Add(listNotMaterial[i]);              
                 LocalLoadManager.Instance.LocalLoadMaterial(listNotMaterial[i]);
@@ -168,7 +169,8 @@ public class DownloadResManager : MonoSingleton<DownloadResManager>
         nowDownLoad--;
         for (int i = 0; i < listNotMaterial.Count; i++)
         {
-            if (Path.GetFileName(listNotMaterial[i].localLoadPath) == localFilePath)
+            Debug.Log("Hjj   DownLoadFaild :" + listNotMaterial[i].downLoadPath + "——" + localFilePath);
+            if (Path.GetFileName(listNotMaterial[i].downLoadPath) == localFilePath)
             {
                 listFaildMaterial.Add(listNotMaterial[i]);
                 MsgHandler.SendMsg(listNotMaterial[i].localLoadPath, null);

+ 169 - 169
Assets/MRNavigatorPro.unity

@@ -2202,7 +2202,7 @@ MeshFilter:
   m_PrefabInstance: {fileID: 0}
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 375338274}
-  m_Mesh: {fileID: 476266338}
+  m_Mesh: {fileID: 769211957}
 --- !u!114 &375338278
 MonoBehaviour:
   m_ObjectHideFlags: 0
@@ -2273,170 +2273,6 @@ Transform:
   m_Father: {fileID: 210725851}
   m_RootOrder: 5
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
---- !u!43 &476266338
-Mesh:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_Name: 
-  serializedVersion: 10
-  m_SubMeshes:
-  - serializedVersion: 2
-    firstByte: 0
-    indexCount: 0
-    topology: 5
-    baseVertex: 0
-    firstVertex: 0
-    vertexCount: 0
-    localAABB:
-      m_Center: {x: 0, y: 0, z: 0}
-      m_Extent: {x: 0, y: 0, z: 0}
-  m_Shapes:
-    vertices: []
-    shapes: []
-    channels: []
-    fullWeights: []
-  m_BindPose: []
-  m_BoneNameHashes: 
-  m_RootBoneNameHash: 0
-  m_BonesAABB: []
-  m_VariableBoneCountWeights:
-    m_Data: 
-  m_MeshCompression: 0
-  m_IsReadable: 1
-  m_KeepVertices: 0
-  m_KeepIndices: 0
-  m_IndexFormat: 1
-  m_IndexBuffer: 
-  m_VertexData:
-    serializedVersion: 3
-    m_VertexCount: 0
-    m_Channels:
-    - stream: 0
-      offset: 0
-      format: 0
-      dimension: 3
-    - stream: 0
-      offset: 0
-      format: 0
-      dimension: 0
-    - stream: 0
-      offset: 0
-      format: 0
-      dimension: 0
-    - stream: 0
-      offset: 0
-      format: 0
-      dimension: 0
-    - stream: 0
-      offset: 0
-      format: 0
-      dimension: 0
-    - stream: 0
-      offset: 0
-      format: 0
-      dimension: 0
-    - stream: 0
-      offset: 0
-      format: 0
-      dimension: 0
-    - stream: 0
-      offset: 0
-      format: 0
-      dimension: 0
-    - stream: 0
-      offset: 0
-      format: 0
-      dimension: 0
-    - stream: 0
-      offset: 0
-      format: 0
-      dimension: 0
-    - stream: 0
-      offset: 0
-      format: 0
-      dimension: 0
-    - stream: 0
-      offset: 0
-      format: 0
-      dimension: 0
-    - stream: 0
-      offset: 0
-      format: 0
-      dimension: 0
-    - stream: 0
-      offset: 0
-      format: 0
-      dimension: 0
-    m_DataSize: 0
-    _typelessdata: 
-  m_CompressedMesh:
-    m_Vertices:
-      m_NumItems: 0
-      m_Range: 0
-      m_Start: 0
-      m_Data: 
-      m_BitSize: 0
-    m_UV:
-      m_NumItems: 0
-      m_Range: 0
-      m_Start: 0
-      m_Data: 
-      m_BitSize: 0
-    m_Normals:
-      m_NumItems: 0
-      m_Range: 0
-      m_Start: 0
-      m_Data: 
-      m_BitSize: 0
-    m_Tangents:
-      m_NumItems: 0
-      m_Range: 0
-      m_Start: 0
-      m_Data: 
-      m_BitSize: 0
-    m_Weights:
-      m_NumItems: 0
-      m_Data: 
-      m_BitSize: 0
-    m_NormalSigns:
-      m_NumItems: 0
-      m_Data: 
-      m_BitSize: 0
-    m_TangentSigns:
-      m_NumItems: 0
-      m_Data: 
-      m_BitSize: 0
-    m_FloatColors:
-      m_NumItems: 0
-      m_Range: 0
-      m_Start: 0
-      m_Data: 
-      m_BitSize: 0
-    m_BoneIndices:
-      m_NumItems: 0
-      m_Data: 
-      m_BitSize: 0
-    m_Triangles:
-      m_NumItems: 0
-      m_Data: 
-      m_BitSize: 0
-    m_UVInfo: 0
-  m_LocalAABB:
-    m_Center: {x: 0, y: 0, z: 0}
-    m_Extent: {x: 1.7014117e+38, y: 1.7014117e+38, z: 1.7014117e+38}
-  m_MeshUsageFlags: 0
-  m_BakedConvexCollisionMesh: 
-  m_BakedTriangleCollisionMesh: 
-  m_MeshMetrics[0]: 1
-  m_MeshMetrics[1]: 1
-  m_MeshOptimizationFlags: 1
-  m_StreamData:
-    serializedVersion: 2
-    offset: 0
-    size: 0
-    path: 
 --- !u!114 &493550942 stripped
 MonoBehaviour:
   m_CorrespondingSourceObject: {fileID: 3134174762876500542, guid: 697420e71aa8bea4b938e2f3986965a6,
@@ -3701,6 +3537,170 @@ MonoBehaviour:
   m_EditorClassIdentifier: 
   RouteItem: {fileID: 275096928}
   m_CalMap: {fileID: 210725852}
+--- !u!43 &769211957
+Mesh:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_Name: 
+  serializedVersion: 10
+  m_SubMeshes:
+  - serializedVersion: 2
+    firstByte: 0
+    indexCount: 0
+    topology: 5
+    baseVertex: 0
+    firstVertex: 0
+    vertexCount: 0
+    localAABB:
+      m_Center: {x: 0, y: 0, z: 0}
+      m_Extent: {x: 0, y: 0, z: 0}
+  m_Shapes:
+    vertices: []
+    shapes: []
+    channels: []
+    fullWeights: []
+  m_BindPose: []
+  m_BoneNameHashes: 
+  m_RootBoneNameHash: 0
+  m_BonesAABB: []
+  m_VariableBoneCountWeights:
+    m_Data: 
+  m_MeshCompression: 0
+  m_IsReadable: 1
+  m_KeepVertices: 0
+  m_KeepIndices: 0
+  m_IndexFormat: 1
+  m_IndexBuffer: 
+  m_VertexData:
+    serializedVersion: 3
+    m_VertexCount: 0
+    m_Channels:
+    - stream: 0
+      offset: 0
+      format: 0
+      dimension: 3
+    - stream: 0
+      offset: 0
+      format: 0
+      dimension: 0
+    - stream: 0
+      offset: 0
+      format: 0
+      dimension: 0
+    - stream: 0
+      offset: 0
+      format: 0
+      dimension: 0
+    - stream: 0
+      offset: 0
+      format: 0
+      dimension: 0
+    - stream: 0
+      offset: 0
+      format: 0
+      dimension: 0
+    - stream: 0
+      offset: 0
+      format: 0
+      dimension: 0
+    - stream: 0
+      offset: 0
+      format: 0
+      dimension: 0
+    - stream: 0
+      offset: 0
+      format: 0
+      dimension: 0
+    - stream: 0
+      offset: 0
+      format: 0
+      dimension: 0
+    - stream: 0
+      offset: 0
+      format: 0
+      dimension: 0
+    - stream: 0
+      offset: 0
+      format: 0
+      dimension: 0
+    - stream: 0
+      offset: 0
+      format: 0
+      dimension: 0
+    - stream: 0
+      offset: 0
+      format: 0
+      dimension: 0
+    m_DataSize: 0
+    _typelessdata: 
+  m_CompressedMesh:
+    m_Vertices:
+      m_NumItems: 0
+      m_Range: 0
+      m_Start: 0
+      m_Data: 
+      m_BitSize: 0
+    m_UV:
+      m_NumItems: 0
+      m_Range: 0
+      m_Start: 0
+      m_Data: 
+      m_BitSize: 0
+    m_Normals:
+      m_NumItems: 0
+      m_Range: 0
+      m_Start: 0
+      m_Data: 
+      m_BitSize: 0
+    m_Tangents:
+      m_NumItems: 0
+      m_Range: 0
+      m_Start: 0
+      m_Data: 
+      m_BitSize: 0
+    m_Weights:
+      m_NumItems: 0
+      m_Data: 
+      m_BitSize: 0
+    m_NormalSigns:
+      m_NumItems: 0
+      m_Data: 
+      m_BitSize: 0
+    m_TangentSigns:
+      m_NumItems: 0
+      m_Data: 
+      m_BitSize: 0
+    m_FloatColors:
+      m_NumItems: 0
+      m_Range: 0
+      m_Start: 0
+      m_Data: 
+      m_BitSize: 0
+    m_BoneIndices:
+      m_NumItems: 0
+      m_Data: 
+      m_BitSize: 0
+    m_Triangles:
+      m_NumItems: 0
+      m_Data: 
+      m_BitSize: 0
+    m_UVInfo: 0
+  m_LocalAABB:
+    m_Center: {x: 0, y: 0, z: 0}
+    m_Extent: {x: 1.7014117e+38, y: 1.7014117e+38, z: 1.7014117e+38}
+  m_MeshUsageFlags: 0
+  m_BakedConvexCollisionMesh: 
+  m_BakedTriangleCollisionMesh: 
+  m_MeshMetrics[0]: 1
+  m_MeshMetrics[1]: 1
+  m_MeshOptimizationFlags: 1
+  m_StreamData:
+    serializedVersion: 2
+    offset: 0
+    size: 0
+    path: 
 --- !u!114 &783368682 stripped
 MonoBehaviour:
   m_CorrespondingSourceObject: {fileID: 6404663699496963397, guid: 6693e68f506a6c944b1783fb7e52a498,
@@ -6643,7 +6643,7 @@ PrefabInstance:
     - target: {fileID: 2656584712679981451, guid: 3e8996c442fe40541beb734ca45f2bf6,
         type: 3}
       propertyPath: m_AnchoredPosition.y
-      value: -0.005122888
+      value: -0.0051131058
       objectReference: {fileID: 0}
     - target: {fileID: 2656584712838976906, guid: 3e8996c442fe40541beb734ca45f2bf6,
         type: 3}
@@ -6773,7 +6773,7 @@ PrefabInstance:
     - target: {fileID: 2656584713474595953, guid: 3e8996c442fe40541beb734ca45f2bf6,
         type: 3}
       propertyPath: m_AnchoredPosition.y
-      value: -0.0018789746
+      value: -0.0018952474
       objectReference: {fileID: 0}
     - target: {fileID: 2656584713571100915, guid: 3e8996c442fe40541beb734ca45f2bf6,
         type: 3}
@@ -9916,7 +9916,7 @@ PrefabInstance:
     - target: {fileID: 486518953982833418, guid: 6693e68f506a6c944b1783fb7e52a498,
         type: 3}
       propertyPath: m_AnchoredPosition.y
-      value: -0.0012144811
+      value: 0.0005653854
       objectReference: {fileID: 0}
     - target: {fileID: 486518953989235048, guid: 6693e68f506a6c944b1783fb7e52a498,
         type: 3}
@@ -13762,7 +13762,7 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 1}
   m_AnchorMax: {x: 1, y: 1}
-  m_AnchoredPosition: {x: 0, y: -0.0051207296}
+  m_AnchoredPosition: {x: 0, y: -0.0051230555}
   m_SizeDelta: {x: 0, y: 0}
   m_Pivot: {x: 0, y: 1}
 --- !u!114 &1180406930876628118

+ 39 - 6
Assets/Scripts/Blue/Command/PointFileGetUrlCommand.cs

@@ -1,6 +1,9 @@
 using Blue;
 using Newtonsoft.Json.Linq;
 using Newtonsoft.Json;
+using LitJson;
+using System.IO;
+using UnityEngine;
 
 /// <summary>
 /// 获取点云文件(json、bytes)的Url下载地址命令
@@ -26,6 +29,7 @@ public class PointFileGetUrlCommand : ICommand
         this.GetService<IPointService>().GetPointFileDownloadUrl(methodName, sceneID.ToString(), fileType, GetPointFileUrlSuccess);
     }
 
+    string PointName;
     private void GetPointFileUrlSuccess(string message)
     {
         if (!string.IsNullOrWhiteSpace(message))
@@ -33,14 +37,43 @@ public class PointFileGetUrlCommand : ICommand
             JObject jobject = JObject.Parse(message);
             if (jobject["code"].ToString() == "200")
             {
-                message = jobject["data"].ToString();
-                if (!string.IsNullOrWhiteSpace(message))
-                {
-                    PointFileData PointFile = JsonConvert.DeserializeObject<PointFileData>(message);
+                Debug.Log("Hjj   message====>"+ message);
+                    JsonData dataJ = JsonMapper.ToObject(message);
+                    string downLoadPath = "";
+                    if (fileType==PointFileType.bytes)
+                    {
+                        downLoadPath = dataJ["data"]["bytesFile"]["path"].ToString();
 
-                    this.GetService<IPointService>().DownloadPointFile(PointFile.url, fileType);
-                }
+                    }
+                    else
+                    {
+                        downLoadPath = dataJ["data"]["jsonFile"]["path"].ToString();
+
+                    }
+
+                    PointName = dataJ["data"]["bytesFile"]["name"].ToString() + "." + dataJ["data"]["bytesFile"]["ext"].ToString();
+                    DownLoadMaterial data = new DownLoadMaterial();
+                    data.downLoadPath = downLoadPath;
+                    data.localLoadPath = Application.persistentDataPath + "/Map Data/" + dataJ["data"]["bytesFile"]["name"].ToString()+"." + dataJ["data"]["bytesFile"]["ext"].ToString(); //Application.persistentDataPath + "/Material/" + Path.GetFileName(value.DownloadPath);
+                data.updataTime = 0;// GameManager.Instance.m_SceneValue.updateTime;
+                    data.type = "3";
+                    MsgHandler.AddListener(downLoadPath, HandleMsg);
+
+
+
+
+                    DownloadResManager.Instance.DownLoad(data);
+                  //  Debug.Log(" SetData " + updateTime);
+
+                //    PointFileData PointFile = JsonConvert.DeserializeObject<PointFileData>(message);
+
+                   //  this.GetService<IPointService>().DownloadPointFile(PointFile.url, fileType);
             }
         }
     }
+    private void HandleMsg(Msg msg)
+    {
+        if (fileType == PointFileType.bytes)
+            this.SendEvent(new LoadMapFileEvent() { fileName = PointName });
+    }
 }

+ 23 - 11
Assets/Scripts/Blue/Service/IPointService.cs

@@ -44,8 +44,8 @@ public class PointService : IPointService
     public void OnInit()
     {
       //UrlPointCloud = "https://pro.qulivr.com/mr-navigator/v1";
-        UrlPointCloud = "https://api-cs.ghz-tech.com/mr-navigator/v1";
-        UrlObjOfReference = "https://api-fat3.ghz-tech.com/mr-navigator/v1/project/unityReference";
+        UrlPointCloud = "https://api-fat2.ghz-tech.com/mr-navigator/v1";
+        UrlObjOfReference = "https://api-fat2.ghz-tech.com/mr-navigator/v1/project/unityReference";
     }
 
     public void GetPoint(string methodName, Action<string> callback)
@@ -54,16 +54,26 @@ public class PointService : IPointService
     }
     public void GetPointFileDownloadUrl(string methodName, string projectId, PointFileType fileType, Action<string> callback)
     {
-        string url = UrlPointCloud + methodName;
-        // 创建URL
-        UriBuilder uriBuilder = new UriBuilder(url);
-        // 添加查询参数
-        uriBuilder.Query = "projectId=" + projectId + "&fileType=" + fileType.ToString();
+        string url = "https://api-fat2.ghz-tech.com/mr-navigator/v1/project/pointcloudInfo";// UrlPointCloud + methodName;
+
         // 创建UnityWebRequest
-        UnityWebRequest webRequest = UnityWebRequest.Get(uriBuilder.Uri);
-        webRequest.SetRequestHeader("Authorization", UserInfo.Instance.Token);
+      //  UnityWebRequest request = new UnityWebRequest(url, "POST");
+
+        // 设置请求头,指定数据类型为 JSON
+       // request.SetRequestHeader("Content-Type", "application/json");
+      //  request.SetRequestHeader("Authorization", UserInfo.Instance.Token);
+        JsonData data = new JsonData();
+        data["projectId"] = int.Parse(projectId);
+        Debug.Log("Hjj  url  " + url);
+        Debug.Log("Hjj  Authorization  " + UserInfo.Instance.Token);
+        Debug.Log("Hjj   ToJson " + data.ToJson());
+        HttpTool.Instance.Post(url, data.ToJson(), callback);
+        // 设置请求体,即包含 JSON 数据的字符串
+      //  byte[] bodyRaw = System.Text.Encoding.UTF8.GetBytes(data.ToJson());
+      //  request.uploadHandler = new UploadHandlerRaw(bodyRaw);
+
         // 发送请求
-        CoroutineSystem.Instance.Start_Coroutine(GetPointGetPointFileRequest(webRequest, callback));
+     //   CoroutineSystem.Instance.Start_Coroutine(GetPointGetPointFileRequest(request, callback));
     }
     public void DownloadPointFile(string downloadingUrl, PointFileType fileType)
     {
@@ -100,7 +110,9 @@ public class PointService : IPointService
     {
         yield return webRequest.SendWebRequest();
 
-        if( webRequest.result == UnityWebRequest.Result.ProtocolError || webRequest.result == UnityWebRequest.Result.ConnectionError)
+        Debug.Log("Hjj  Back  GetPointFileDownloadUrl : ");
+        Debug.Log("Hjj  Back  GetPointFileDownloadUrl : ");
+        if ( webRequest.result == UnityWebRequest.Result.ProtocolError || webRequest.result == UnityWebRequest.Result.ConnectionError)
             Debug.LogError("GetPointFileDownloadUrl failed: " + webRequest.error);
         else
             callback?.Invoke(webRequest.downloadHandler.text);

+ 17 - 7
Assets/Scripts/Blue/Service/IUpOrDownloadService.cs

@@ -25,15 +25,15 @@ public class UpOrDownloadService : IUpOrDownloadService
     public void OnInit()
     {
        // UrlPointCloudPosRot = "http://192.168.50.114:8888/mr-navigator/v1/project/position";
-        UrlPointCloudPosRot = "https://api-fat3.ghz-tech.com/mr-navigator/v1/project/position";
+        UrlPointCloudPosRot = "https://api-fat2.ghz-tech.com/mr-navigator/v1/project/position";
 
     }
 
     void IUpOrDownloadService.GetScenePosRot(int projectID)
     {
-      //  TimerMgr.Instance.CreateTimer(()=> {
+        TimerMgr.Instance.CreateTimer(()=> {
         CoroutineSystem.Instance.StartCoroutine(GetScenePosRotRequest(projectID));
-     //   },3,-1);
+       },1,1);
     }
 
     void IUpOrDownloadService.UploadScenePosRot(string Url, string JsonString)
@@ -70,17 +70,27 @@ public class UpOrDownloadService : IUpOrDownloadService
                     JObject jobject = JObject.Parse(message);
                     if (jobject["code"].ToString() == "200")
                     {
-                        message = jobject["data"].ToString();
+                        message = jobject["data"]["position"].ToString();
+                        Debug.Log("Hjj   message===>"+ message);
                         if (!string.IsNullOrWhiteSpace(message))
                         {
                            // TimerMgr.Instance.CreateTimer(() => {
                                 List<ScenePosRotInfo> ScenePosRotInfoList = JsonConvert.DeserializeObject<List<ScenePosRotInfo>>(message);
 
                             //  GongShi2.F2Dto3D(ScenePosRotInfoList[0].x, ScenePosRotInfoList[0].y, 643f, 1920f, ScenePosRotInfoList[1].x, ScenePosRotInfoList[1].y, 51f, 17.1f);
-                            
+                            if(ScenePosRotInfoList[0].x==0 && ScenePosRotInfoList[0].y == 0 && ScenePosRotInfoList[0].z == 0&& ScenePosRotInfoList[1].x == 0 && ScenePosRotInfoList[1].y == 0 && ScenePosRotInfoList[1].z == 0)
+                            {
+
+                            }else
+                            {
+
+                                Debug.Log("Hjj   message=1==>" + ScenePosRotInfoList[0].x);
+                                Debug.Log("Hjj   message=2==>" + DataManager.Instance.CurrentScene.width);
+                                Debug.Log("Hjj   message=3==>" + GameManager.Instance.WebMapSize.x);
                                 GongShi2.F2Dto3D(ScenePosRotInfoList[0].x, ScenePosRotInfoList[0].y, GameManager.Instance.WebMapSize.y, GameManager.Instance.WebMapSize.x, ScenePosRotInfoList[1].x, ScenePosRotInfoList[1].y, DataManager.Instance.CurrentScene.length, DataManager.Instance.CurrentScene.width);
-                 
-                         //  },0.03f,-1);
+
+                            }
+                            //  },0.03f,-1);
                         }
                     }
                 }

+ 1 - 1
Assets/Scripts/Net/HttpTool.cs

@@ -153,7 +153,7 @@ public class HttpTool : MonoSingleton<HttpTool>
             yield return webRequest.SendWebRequest();
 
             Debug.Log("CallBack==>"+ webRequest.downloadHandler.text);
-            if (webRequest.isHttpError || webRequest.isNetworkError)
+            if (webRequest.isHttpError || webRequest.isNetworkError)//webRequest.result == UnityWebRequest.Result.ProtocolError || webRequest.result == UnityWebRequest.Result.ConnectionError
             {
                 Debug.LogError(url + "\n" + webRequest.error + "\n" + webRequest.downloadHandler.text);
                 string error = webRequest.downloadHandler.text;

+ 11 - 2
Assets/Scripts/UI/GameManager.cs

@@ -649,7 +649,7 @@ public class GameManager : MonoSingleton<GameManager>
         SceneValue = scene;
         if (m_MinMap.Map.sprite == null)
         {
-            GetMinMap(scene );
+            GetMinMap(scene ,null);
         }
         else
         {
@@ -685,11 +685,14 @@ public class GameManager : MonoSingleton<GameManager>
         UIManager.Instance.ShowUI(UINameConfig.LoadingPanel, typeof(LoadingPanel), (int)ELoadState.download);
         DownloadManager.Instance.UpdataData();
     }
+    Action<bool> GetMinMapBack;
     /// <summary>
     /// 获取小地图
     /// </summary>
-    public void GetMinMap( SceneValue scene )
+    public void GetMinMap( SceneValue scene ,Action<bool> getBack)
     {
+        GetMinMapBack = getBack;
+        Debug.Log("Hjj 开始获取地图大小==》");
         DownloadData data1 = new DownloadData();
         string filename = Path.GetFileName(MapPicUrl);
         data1.name = filename;
@@ -759,6 +762,7 @@ public class GameManager : MonoSingleton<GameManager>
 
     private void HandleMsg(Msg msg)
     {
+        Debug.Log("Hjj 获取地图大小==》");
        // MsgHandler.RemoveListener()
        if(msg.Value!=null)
         {
@@ -793,6 +797,11 @@ public class GameManager : MonoSingleton<GameManager>
             {
                 StartCreateScene(SceneValue);
             }
+            GetMinMapBack?.Invoke(true);
+        }else
+        {
+
+            GetMinMapBack?.Invoke(false);
         }
     }
 

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

@@ -92,7 +92,7 @@ public class LoginPanel : BaseUI
 
         //m_SNBtn.onClick.AddListener(OnClickSnBtn);
 
-         OnClickLogin();
+        // OnClickLogin();
     }
 
     #region UI监听事件
@@ -259,13 +259,6 @@ public class LoginPanel : BaseUI
     /// </summary>
     private void OnClickLogin()
     {
-
-#if UNITY_EDITOR
-        // m_AccountStr = "1768147286@qq.com";
-        //m_AccountStr = "666666@qq.com";
-        //m_PasswordStr = "ghztech@402B";
-        m_AccountStr = "jiajun.hu@ghz-tech.com";
-#endif
         if (string.IsNullOrWhiteSpace(m_AccountStr))
         {
             //m_AccountError.gameObject.SetActive(true);
@@ -599,7 +592,7 @@ public class LoginPanel : BaseUI
                 string filename = Path.GetFileName(mat.icon);
                 data1.downLoadPath = mat.icon;
                 data1.updataTime = mat.updateTime;
-                data1.type = "1";
+
                 data1.localLoadPath = Application.persistentDataPath + "/Materail/" + filename;
                 listMaterail.Add(data1);
             }
@@ -615,7 +608,6 @@ public class LoginPanel : BaseUI
                         data1.downLoadPath = matObj.DownloadPath;
                         data1.updataTime = mat.updateTime;
                         data1.localLoadPath = Application.persistentDataPath + "/Materail/" + filename;
-                        data1.type = "1";
                         listMaterail.Add(data1);
                     }
                 }
@@ -665,7 +657,11 @@ public class LoginPanel : BaseUI
 
         //m_AccountStr = "test_adv@ghz-tech.com";
         //m_PasswordStr = "123456789";
-
+#if UNITY_EDITOR
+        //   m_AccountStr = "1768147286@qq.com";
+        m_AccountStr = "jiajun.hu@ghz-tech.com";
+        m_PasswordStr = "123456Aa";
+#endif
         //m_AccountStr = "2463951@qq.com";
         //m_PasswordStr = "123456Aa";
 
@@ -674,14 +670,7 @@ public class LoginPanel : BaseUI
 
         m_RemenberPwd.isOn = m_IsRemberPwd;
 
-#if UNITY_EDITOR
-        // m_AccountStr = "ghztest2@ghz-tech.com";
-        // m_PasswordStr = "123456Aa";
-        m_AccountStr = "1768147286@qq.com";
-        m_AccountStr = "jiajun.hu@ghz-tech.com";
-        // m_AccountStr = "yhb_adv10@1.com";
-        m_PasswordStr = "123456Aa";
-#endif
+
         if (!string.IsNullOrWhiteSpace(m_AccountStr) && !string.IsNullOrWhiteSpace(m_PasswordStr))
         {
             m_Account.text = m_AccountStr;

+ 54 - 39
Assets/Scripts/UI/SceneChoose.cs

@@ -94,11 +94,18 @@ public class SceneChoose : BaseUI
                 {
                     mes = jObject["data"].ToString();
                     SceneValue scene = JsonConvert.DeserializeObject<SceneValue>(mes);
-                    Debug.Log("scene.backgroundImages===>" );
+                    Debug.Log("scene.backgroundImages===>" + mes);
                     Debug.Log("scene.backgroundImages===>"+ scene.backgroundImages.Count);
                     GameManager.Instance.MapPicUrl = scene.backgroundImages[0].base64;
-                    GameManager.Instance.GetMinMap(scene);
-                    GetSNInit();
+                    GameManager.Instance.GetMinMap(scene, (bool back) =>
+                    {
+                        if (back)
+                        {
+                            GetSNInit();
+                        }
+
+                    } );
+
                 }
                 else
                 {
@@ -138,26 +145,29 @@ public class SceneChoose : BaseUI
             Debug.Log("通过SN获取场景数据:" + message);
             if (!string.IsNullOrWhiteSpace(message))
             {
-                JObject jobject = JObject.Parse(message);
+                Debug.Log("Hjj   当前选择场景数据 1: " + message);
+                JsonData jobject = JsonMapper.ToObject(message);
 
-                if (jobject.GetValue("code") != null)
+                if (!jobject.Keys.Contains("code") ||jobject["code"].ToJson() == "400")
                 {
-                    if (jobject["code"].ToString() == "400")
-                    {
                         UIManager.Instance.HideUI(UINameConfig.LoadingPanel);
                         //Module_Notice.getInstance.SetNoticeInfo("场景数据获取失败", jobject["data"].ToString(), NoticeType.Normal, 1.7f);
                         //Module_Notice.getInstance._Follower.WindowAnchor = TextAnchor.UpperCenter;
                         //Module_Notice.getInstance.StartNotice(3f);
-                    }
                 }
                 else
                 {
-                    message = jobject["data"].ToString();
-                    GameManager.Instance.text.text = message;
-                  //  SceneValue scene = JsonMapper.ToObject<SceneValue>(message);
+                    message = jobject["data"]["info"].ToJson();
+                  //  GameManager.Instance.text.text = message;
+                    //  SceneValue scene = JsonMapper.ToObject<SceneValue>(message);
 
+                    Debug.Log("Hjj   当前选择场景数据 : " + message);
                     SceneValue scene = JsonConvert.DeserializeObject<SceneValue>(message);
+                    Debug.Log("Hjj   当前选择场景数据: " + scene.width);
+                    Debug.Log("Hjj   当前选择场景数据: " + scene.length);
                     DataManager.Instance.CurrentScene = scene;
+                    Debug.Log("Hjj   当前选择场景数据: " + DataManager.Instance.CurrentScene.width);
+                    Debug.Log("Hjj   当前选择场景数据: " + DataManager.Instance.CurrentScene.length);
                     DataManager.Instance.ProjectID = m_CurrentData.id;
                     UIManager.Instance.ShowUI(UINameConfig.LoadingPanel, typeof(LoadingPanel), (int)ELoadState.createScene);
                     StartCoroutine(GetSpoitValueDetail(scene));
@@ -191,43 +201,48 @@ public class SceneChoose : BaseUI
                 if (jObject["code"].ToString() == "200")
                 {
                     message = jObject["data"].ToString();
+                    Debug.Log("Hjj  jObjectjObjectjObject " + message);
                     SpoitValueDetail spoit = JsonConvert.DeserializeObject<SpoitValueDetail>(message);
                     GameManager.Instance.SpoitsValueDetail.Add(spoit.id, spoit);
                 }
             }));
         }
-        Debug.Log(scene.vuforiaXML);
-        string xmlName = Path.GetFileName(scene.vuforiaXML);
-
-        if (xmlName != null)
+        Debug.Log("Hjj  scene.vuforiaXML" + scene.vuforiaXML);
+        if(UserInfo.Instance.is20)
         {
-            xmlName = xmlName.Substring(0, xmlName.Length - 4);
-            AppConfigConst.IMAGE_TARGET_FILE_NAME = xmlName;
-        }
 
+            string xmlName = Path.GetFileName(scene.vuforiaXML);
+
+            if (xmlName != null)
+            {
+                xmlName = xmlName.Substring(0, xmlName.Length - 4);
+                AppConfigConst.IMAGE_TARGET_FILE_NAME = xmlName;
+            }
 
-      
 
-        if (scene.vuforiaXML != null)
-        {
-            DownloadData xml = new DownloadData();
-            string filename = Path.GetFileName(scene.vuforiaXML);
-            xml.name = filename;
-            xml.type = 8;
-            xml.downloadPath = scene.vuforiaXML;
-            xml.updateTime = (int)scene.updateTime;
-            xml.localSavePath = Application.persistentDataPath + "/StreamingAssets/Vuforia/" + filename;
-            DownloadManager.Instance.AddDownloadData(xml);
-
-            DownloadData dat = new DownloadData();
-            string filename2 = Path.GetFileName(scene.vuforiaDat);
-            dat.name = filename2;
-            dat.type = 8;
-            dat.downloadPath = scene.vuforiaDat;
-            dat.updateTime = (int)scene.updateTime;
-            dat.localSavePath = Application.persistentDataPath + "/StreamingAssets/Vuforia/" + filename2;
-
-            DownloadManager.Instance.AddDownloadData(dat);
+
+
+            if (scene.vuforiaXML != null)
+            {
+                DownloadData xml = new DownloadData();
+                string filename = Path.GetFileName(scene.vuforiaXML);
+                xml.name = filename;
+                xml.type = 8;
+                xml.downloadPath = scene.vuforiaXML;
+                xml.updateTime = (int)scene.updateTime;
+                xml.localSavePath = Application.persistentDataPath + "/StreamingAssets/Vuforia/" + filename;
+                DownloadManager.Instance.AddDownloadData(xml);
+
+                DownloadData dat = new DownloadData();
+                string filename2 = Path.GetFileName(scene.vuforiaDat);
+                dat.name = filename2;
+                dat.type = 8;
+                dat.downloadPath = scene.vuforiaDat;
+                dat.updateTime = (int)scene.updateTime;
+                dat.localSavePath = Application.persistentDataPath + "/StreamingAssets/Vuforia/" + filename2;
+
+                DownloadManager.Instance.AddDownloadData(dat);
+            }
         }
 
         yield return new WaitForSeconds(1f);

+ 3 - 3
ProjectSettings/ProjectSettings.asset

@@ -924,7 +924,6 @@ PlayerSettings:
   metroSplashScreenUseBackgroundColor: 1
   platformCapabilities:
     WindowsStoreApps:
-      CodeGeneration: False
       OfflineMapsManagement: False
       HumanInterfaceDevice: False
       Location: False
@@ -936,6 +935,7 @@ PlayerSettings:
       PrivateNetworkClientServer: False
       InternetClientServer: False
       VideosLibrary: False
+      BackgroundMediaPlayback: False
       Objects3D: False
       RemoteSystem: False
       BlockedChatMessages: False
@@ -957,9 +957,9 @@ PlayerSettings:
       PointOfService: False
       RecordedCallsFolder: False
       Contacts: False
-      Proximity: False
       InternetClient: True
-      BackgroundMediaPlayback: False
+      Proximity: False
+      CodeGeneration: False
       EnterpriseAuthentication: False
   metroTargetDeviceFamilies:
     Desktop: False