Эх сурвалжийг харах

触发 小地图路线 Slam版

Dai Guangjun 4 жил өмнө
parent
commit
60f930ea53

+ 28 - 52
Assets/StreamingAssets/projectInfo.json

@@ -7,10 +7,10 @@
 			"name": "line one",
 			"points": [{
 				"D": 90,
-				"MN": "Transformers",
+				"MN": "Party",
 				"MP": [{
-					"X": 7.7,
-					"Y": 1.5,
+					"X": 3.4,
+					"Y": 2.65,
 					"Z": -1
 				}],
 				"T": 1,
@@ -31,10 +31,10 @@
 				"Z": 1.2
 			}, {
 				"D": 90,
-				"MN": "Car",
+				"MN": "Gongye",
 				"MP": [{
-					"X": 4,
-					"Y": 4.8,
+					"X": 3.135941,
+					"Y": 3.047386,
 					"Z": -1
 				}],
 				"T": 1,
@@ -47,8 +47,8 @@
 				"D": 90,
 				"MN": "Subway",
 				"MP": [{
-					"X": 6.5,
-					"Y": 2.7,
+					"X": 6.53,
+					"Y": 2.82,
 					"Z": -1
 				}],
 				"T": 1,
@@ -59,10 +59,10 @@
 				"Z": 1.2
 			}, {
 				"D": 90,
-				"MN": "Solar",
+				"MN": "Chemical",
 				"MP": [{
-					"X": 15.3,
-					"Y": 4.8,
+					"X": 6.53,
+					"Y": 2.82,
 					"Z": -1
 				}],
 				"T": 1,
@@ -85,20 +85,8 @@
 				"D": 270,
 				"MN": "Library",
 				"MP": [{
-					"X": 12.8,
-					"Y": 2.6,
-					"Z": -1
-				}, {
-					"X": 11.1,
-					"Y": 2.6,
-					"Z": -1
-				}, {
-					"X": 9.4,
-					"Y": 2.6,
-					"Z": -1
-				}, {
-					"X": 8.4,
-					"Y": 1.75,
+					"X": 6.53,
+					"Y": 2.82,
 					"Z": -1
 				}],
 				"T": 1,
@@ -114,20 +102,8 @@
 				"D": 270,
 				"MN": "Library",
 				"MP": [{
-					"X": 12.8,
-					"Y": 2.6,
-					"Z": -1
-				}, {
-					"X": 11.1,
-					"Y": 2.6,
-					"Z": -1
-				}, {
-					"X": 9.4,
-					"Y": 2.6,
-					"Z": -1
-				}, {
-					"X": 8.4,
-					"Y": 1.75,
+					"X": 6.53,
+					"Y": 2.82,
 					"Z": -1
 				}],
 				"T": 1,
@@ -148,10 +124,10 @@
 				"Z": 1.2
 			}, {
 				"D": 90,
-				"MN": "Solar",
+				"MN": "Chemical",
 				"MP": [{
-					"X": 15.3,
-					"Y": 4.8,
+					"X": 6.53,
+					"Y": 2.82,
 					"Z": -1
 				}],
 				"T": 1,
@@ -164,8 +140,8 @@
 				"D": 90,
 				"MN": "Subway",
 				"MP": [{
-					"X": 6.5,
-					"Y": 2.7,
+					"X": 6.53,
+					"Y": 2.82,
 					"Z": -1
 				}],
 				"T": 1,
@@ -176,10 +152,10 @@
 				"Z": 1.2
 			}, {
 				"D": 90,
-				"MN": "Car",
+				"MN": "Gongye",
 				"MP": [{
-					"X": 4,
-					"Y": 4.8,
+					"X": 3.135941,
+					"Y": 3.047386,
 					"Z": -1
 				}],
 				"T": 1,
@@ -200,17 +176,17 @@
 				"Z": 1.2
 			}, {
 				"D": 90,
-				"MN": "Transformers",
+				"MN": "Party",
 				"MP": [{
-					"X": 7.7,
-					"Y": 1.5,
+					"X": 3.4,
+					"Y": 2.65,
 					"Z": -1
 				}],
 				"T": 1,
 				"TH": 1,
 				"TL": 2,
-				"X": 2,
-				"Y": 1.7,
+				"X": 2.0199999999999996,
+				"Y": 1.68,
 				"Z": 1.2
 			}]
 		}]

+ 33 - 3
Assets/XDKUnityCloudExamples/Common/Scripts/Test/TeshMap.cs

@@ -40,11 +40,14 @@ public class TeshMap : MonoBehaviour
 
     List<Vector3> listPointPos;
     List<Vector3> listMapRoutePos;
+    Dictionary<int, List<Vector3>> mapRoutePos;
+   
     Vector3 oldPos;
     float times;
-    int Index = 0;
+    int Index = -1;
     private void Start()
     {
+        mapRoutePos = new Dictionary<int, List<Vector3>>();
         listMapRoutePos = new List<Vector3>();
         Debug.Log(mapPointA.eulerAngles + " mapPointA " + mapPointA.localEulerAngles);
         disX = Mathf.Abs(mapPointB.localPosition.x - mapPointA.localPosition.x);
@@ -104,20 +107,47 @@ public class TeshMap : MonoBehaviour
     }
 
 
-    public void ADDMapRoutePoint(Vector3 pos)
+    public void ADDMapRoutePoint(Vector3 pos , int Index)
     {
-        listMapRoutePos.Add(pos);
+        if (this.Index == -1)
+            this.Index = Index;
+        if(Index!=this.Index)
+        {
+            listMapRoutePos.Clear();
+            this.Index = Index;
+        }
+
+        if (Index == this.Index)
+            listMapRoutePos.Add(pos);
+        //if (!mapRoutePos.ContainsKey(Index))
+        //{
+
+        //    listMapRoutePos = new List<Vector3>();
+        //    listMapRoutePos.Clear();
+        //    listMapRoutePos.Add(pos);
+        //    mapRoutePos.Add(Index, listMapRoutePos);
+        //}
+     
+        //    mapRoutePos[Index] = listMapRoutePos;
+
     }
 
     public void SettingMapRoute()
     {
+
+
+     //   listMapRoutePos = mapRoutePos[0];
+
         for (int i = 0; i < listMapRoutePos.Count; i++)
         {
             float x = Mathf.Abs(listMapRoutePos[i].x - mapPointA.localPosition.x) / disX;
             float z = Mathf.Abs(listMapRoutePos[i].z - mapPointA.localPosition.z) / disZ;
             listMapRoutePos[i] = new Vector3(z, x, 0);
+            Debug.Log(listMapRoutePos[i]);
         }
 
+       
+
         testMaxMapShow.SettingMapRoute(listMapRoutePos);
     }
 

+ 6 - 6
Assets/XDKUnityCloudExamples/Common/Scripts/Test/TestJsonManage.cs

@@ -121,12 +121,11 @@ public class TestJsonManage : MonoBehaviour
                 route.GetComponent<TestRoute>().SetRoute(endPos, exitPos , Index);
                 route.SetActive(true);
 
-
             // 地图显示路径
-            teshMap.ADDMapRoutePoint(endPos);
+            teshMap.ADDMapRoutePoint(endPos,Index);
                 
             }
-        teshMap.ADDMapRoutePoint(new Vector3((float)data.points[data.points.Count - 1].X, 0, (float)data.points[data.points.Count - 1].Y));
+        teshMap.ADDMapRoutePoint(new Vector3((float)data.points[data.points.Count - 1].X, 0, (float)data.points[data.points.Count - 1].Y),Index);
         teshMap.SettingMapRoute();
 
         list_route.Add(routes);
@@ -184,17 +183,17 @@ public class TestJsonManage : MonoBehaviour
                 {
                     switch (data.navLines[i].points[j].MN)
                     {
-                        case "Transformers":
+                        case "Party":
                             QueryBox("Party", data.navLines[i].points[j]);  
                             break;
-                        case "Car":
+                        case "Gongye":
                             QueryBox("Gongye", data.navLines[i].points[j]);
                             break;
                         case "Subway":
                             QueryBox("Subway", data.navLines[i].points[j]);
                             break;
 
-                        case "Solar":
+                        case "Chemical":
                             QueryBox("Chemical", data.navLines[i].points[j]);
                             break;
                         case "Library":
@@ -246,6 +245,7 @@ public class TestJsonManage : MonoBehaviour
         box.position = new Vector3((float)points.X, -1f, (float)points.Y);     
         crystal.position = new Vector3(box.position.x, -3f, box.position.z);
         obj.position = new Vector3((float)points.MP[0].X, points.MP[0].Z==-1?obj.position.y:(float)points.MP[0].Z, (float)points.MP[0].Y);
+        Debug.Log(obj.name + "       " + obj.position);
        
     }
  

+ 3 - 3
Assets/XDKUnityCloudExamples/Common/Scripts/Test/TestMapShow.cs

@@ -106,12 +106,12 @@ public class TestMapShow : MonoBehaviour
 
     public void SettingMapRoute(List<Vector3> listMapRoutePos)
     {
-        line.positionCount = listMapRoutePos.Count/2+1;
-        for (int i = listMapRoutePos.Count / 2; i < listMapRoutePos.Count; i++)
+        line.positionCount = listMapRoutePos.Count;
+        for (int i = 0 ; i < listMapRoutePos.Count; i++)
         {
             Rpoint.anchoredPosition = new Vector3(canvas.rect.width * listMapRoutePos[i].x, canvas.rect.height * listMapRoutePos[i].y, transform.position.z);
             listMapRoutePos[i] = Rpoint.position;
-            line.SetPosition(i- listMapRoutePos.Count / 2, listMapRoutePos[i]);
+            line.SetPosition(i, listMapRoutePos[i]);
         }
 
         

+ 39 - 37
Assets/XDKUnityCloudExamples/Demo/Scenes/Demo.unity

@@ -4969,12 +4969,6 @@ CanvasRenderer:
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 297697346}
   m_CullTransparentMesh: 0
---- !u!1 &299324718 stripped
-GameObject:
-  m_CorrespondingSourceObject: {fileID: 3533093034596993700, guid: 78f21f01a262956408d53995918ec746,
-    type: 3}
-  m_PrefabInstance: {fileID: 355810095}
-  m_PrefabAsset: {fileID: 0}
 --- !u!4 &299324719 stripped
 Transform:
   m_CorrespondingSourceObject: {fileID: 3533093034596993881, guid: 78f21f01a262956408d53995918ec746,
@@ -7364,6 +7358,12 @@ Transform:
     type: 3}
   m_PrefabInstance: {fileID: 490013420}
   m_PrefabAsset: {fileID: 0}
+--- !u!1 &490013422 stripped
+GameObject:
+  m_CorrespondingSourceObject: {fileID: 1269803834018763930, guid: c2949074f3b713b4abec308e62ad895b,
+    type: 3}
+  m_PrefabInstance: {fileID: 490013420}
+  m_PrefabAsset: {fileID: 0}
 --- !u!1 &494839278
 GameObject:
   m_ObjectHideFlags: 0
@@ -8379,6 +8379,11 @@ PrefabInstance:
       propertyPath: m_Name
       value: Party
       objectReference: {fileID: 0}
+    - target: {fileID: 3249993816449647452, guid: 5ff5239ec426eca42a2bd1d84c8de189,
+        type: 3}
+      propertyPath: m_IsActive
+      value: 0
+      objectReference: {fileID: 0}
     - target: {fileID: 3249993816449647440, guid: 5ff5239ec426eca42a2bd1d84c8de189,
         type: 3}
       propertyPath: m_LocalPosition.x
@@ -11657,6 +11662,12 @@ Transform:
     type: 3}
   m_PrefabInstance: {fileID: 897947973}
   m_PrefabAsset: {fileID: 0}
+--- !u!1 &897947975 stripped
+GameObject:
+  m_CorrespondingSourceObject: {fileID: 1269803834018763930, guid: c2949074f3b713b4abec308e62ad895b,
+    type: 3}
+  m_PrefabInstance: {fileID: 897947973}
+  m_PrefabAsset: {fileID: 0}
 --- !u!1 &898594156
 GameObject:
   m_ObjectHideFlags: 0
@@ -12527,32 +12538,23 @@ MonoBehaviour:
   m_EditorClassIdentifier: 
   text: {fileID: 1521592881}
   list_box:
-  - {fileID: 174553218}
-  - {fileID: 174553218}
-  - {fileID: 174553218}
-  - {fileID: 174553218}
   - {fileID: 1335957572}
   - {fileID: 198380071}
-  - {fileID: 446303756}
   - {fileID: 2352424}
+  - {fileID: 446303756}
+  - {fileID: 174553218}
   list_Effects:
-  - {fileID: 1300656004}
-  - {fileID: 299324718}
-  - {fileID: 1589591881}
-  - {fileID: 1664086426}
   - {fileID: 3249993815787806377}
   - {fileID: 801006673}
-  - {fileID: 242924311}
   - {fileID: 1870624491}
+  - {fileID: 242924311}
+  - {fileID: 885482082}
   list_points:
-  - {fileID: 0}
-  - {fileID: 0}
-  - {fileID: 0}
-  - {fileID: 0}
   - {fileID: 1421033885}
-  - {fileID: 0}
-  - {fileID: 0}
-  - {fileID: 0}
+  - {fileID: 1551589146}
+  - {fileID: 897947975}
+  - {fileID: 490013422}
+  - {fileID: 1325151833}
   mapPlayer: {fileID: 163467652}
   teshMap: {fileID: 1801162214}
   testP6Car: {fileID: 970254223}
@@ -16306,6 +16308,12 @@ Transform:
     type: 3}
   m_PrefabInstance: {fileID: 1325151831}
   m_PrefabAsset: {fileID: 0}
+--- !u!1 &1325151833 stripped
+GameObject:
+  m_CorrespondingSourceObject: {fileID: 1269803834018763930, guid: c2949074f3b713b4abec308e62ad895b,
+    type: 3}
+  m_PrefabInstance: {fileID: 1325151831}
+  m_PrefabAsset: {fileID: 0}
 --- !u!1 &1335957572
 GameObject:
   m_ObjectHideFlags: 0
@@ -18215,7 +18223,7 @@ Light:
   m_BounceIntensity: 1
   m_ColorTemperature: 6570
   m_UseColorTemperature: 0
-  m_BoundingSphereOverride: {x: 9.120958e-19, y: -2.0578819e-13, z: 6.43e-43, w: 2.96e-43}
+  m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
   m_UseBoundingSphereOverride: 0
   m_ShadowRadius: 0
   m_ShadowAngle: 0
@@ -20082,6 +20090,12 @@ Transform:
     type: 3}
   m_PrefabInstance: {fileID: 1551589144}
   m_PrefabAsset: {fileID: 0}
+--- !u!1 &1551589146 stripped
+GameObject:
+  m_CorrespondingSourceObject: {fileID: 1269803834018763930, guid: c2949074f3b713b4abec308e62ad895b,
+    type: 3}
+  m_PrefabInstance: {fileID: 1551589144}
+  m_PrefabAsset: {fileID: 0}
 --- !u!1 &1555642070
 GameObject:
   m_ObjectHideFlags: 0
@@ -20275,12 +20289,6 @@ MonoBehaviour:
   minMap: {fileID: 1028361293}
   maxMap: {fileID: 123602703}
   text: {fileID: 110016786}
---- !u!1 &1589591881 stripped
-GameObject:
-  m_CorrespondingSourceObject: {fileID: 249887172168825632, guid: ab1b27b41b36a344d815e76a0dfc0bc6,
-    type: 3}
-  m_PrefabInstance: {fileID: 899839370}
-  m_PrefabAsset: {fileID: 0}
 --- !u!4 &1589591883 stripped
 Transform:
   m_CorrespondingSourceObject: {fileID: 249887172168825643, guid: ab1b27b41b36a344d815e76a0dfc0bc6,
@@ -21056,12 +21064,6 @@ Transform:
     type: 3}
   m_PrefabInstance: {fileID: 1651002351}
   m_PrefabAsset: {fileID: 0}
---- !u!1 &1664086426 stripped
-GameObject:
-  m_CorrespondingSourceObject: {fileID: 2942046310108410636, guid: 791997678e61bd1469090810d93716b7,
-    type: 3}
-  m_PrefabInstance: {fileID: 217096912}
-  m_PrefabAsset: {fileID: 0}
 --- !u!4 &1664086427 stripped
 Transform:
   m_CorrespondingSourceObject: {fileID: 2942046310108410625, guid: 791997678e61bd1469090810d93716b7,
@@ -22912,7 +22914,7 @@ MonoBehaviour:
   m_PrefabInstance: {fileID: 0}
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 1758681227}
-  m_Enabled: 1
+  m_Enabled: 0
   m_EditorHideFlags: 0
   m_Script: {fileID: 11500000, guid: 8f82f70b648ee024ab90edf55068994f, type: 3}
   m_Name: 

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 348 - 284
Assets/XDKUnityCloudExamples/Demo/Scenes/DemoTest.unity


+ 1 - 1
Assets/XDKUnityCloudExamples/Demo/Scenes/SlamDemo.2.unity.meta → Assets/XDKUnityCloudExamples/Demo/Scenes/DemoTest.unity.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 12d7444e98717454e8da8b5f818a6a1a
+guid: 6da09f360673c5d429ccf1b41d20c6a4
 DefaultImporter:
   externalObjects: {}
   userData: 

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно