tanghai 3 лет назад
Родитель
Сommit
a7142930f4

+ 1 - 1
Unity/Assets/Config/Proto/OuterMessage_C_10001.proto

@@ -59,7 +59,7 @@ message G2C_EnterMap // IResponse
 
 message MoveInfo
 {
-	repeated Unity.Mathematics.float3 Position = 1;
+	repeated Unity.Mathematics.float3 Points = 1;
 	Unity.Mathematics.quaternion Rotation = 2;
 	int32 TurnSpeed = 3;
 }

+ 1 - 1
Unity/Assets/Plugins/MongoDB/MongoDB.Driver.Core.dll.meta

@@ -47,7 +47,7 @@ PluginImporter:
     second:
       enabled: 1
       settings:
-        CPU: x86_64
+        CPU: AnyCPU
   - first:
       Standalone: OSXUniversal
     second:

+ 1 - 1
Unity/Assets/Plugins/MongoDB/MongoDB.Driver.dll.meta

@@ -47,7 +47,7 @@ PluginImporter:
     second:
       enabled: 1
       settings:
-        CPU: x86_64
+        CPU: AnyCPU
   - first:
       Standalone: OSXUniversal
     second:

+ 1 - 1
Unity/Assets/Plugins/MongoDB/MongoDB.Libmongocrypt.dll.meta

@@ -47,7 +47,7 @@ PluginImporter:
     second:
       enabled: 1
       settings:
-        CPU: x86_64
+        CPU: AnyCPU
   - first:
       Standalone: OSXUniversal
     second:

+ 1 - 1
Unity/Assets/Plugins/MongoDB/SharpCompress.dll.meta

@@ -47,7 +47,7 @@ PluginImporter:
     second:
       enabled: 1
       settings:
-        CPU: x86_64
+        CPU: AnyCPU
   - first:
       Standalone: OSXUniversal
     second:

+ 1 - 1
Unity/Assets/Plugins/MongoDB/System.Text.Encoding.CodePages.dll.meta

@@ -47,7 +47,7 @@ PluginImporter:
     second:
       enabled: 1
       settings:
-        CPU: x86_64
+        CPU: AnyCPU
   - first:
       Standalone: OSXUniversal
     second:

+ 2 - 6
Unity/Assets/Scripts/Codes/Hotfix/Client/Demo/Move/M2C_PathfindingResultHandler.cs

@@ -1,5 +1,4 @@
-using System.Collections.Generic;
-using Unity.Mathematics;
+
 
 namespace ET.Client
 {
@@ -12,10 +11,7 @@ namespace ET.Client
 
 			float speed = unit.GetComponent<NumericComponent>().GetAsFloat(NumericType.Speed);
 
-			using (ListComponent<float3> list = ListComponent<float3>.Create())
-			{
-				await unit.GetComponent<MoveComponent>().MoveToAsync(message.Points, speed);
-			}
+			await unit.GetComponent<MoveComponent>().MoveToAsync(message.Points, speed);
 		}
 	}
 }

+ 3 - 5
Unity/Assets/Scripts/Codes/Hotfix/Client/Demo/Unit/UnitFactory.cs

@@ -22,12 +22,10 @@ namespace ET.Client
 	        unit.AddComponent<MoveComponent>();
 	        if (unitInfo.MoveInfo != null)
 	        {
-		        if (unitInfo.MoveInfo.Position.Count > 0)
+		        if (unitInfo.MoveInfo.Points.Count > 0)
 				{
-					using ListComponent<float3> list = ListComponent<float3>.Create();
-					list.Add(unit.Position);
-					list.AddRange(unitInfo.MoveInfo.Position);
-					unit.MoveToAsync(list).Coroutine();
+					unitInfo.MoveInfo.Points[0] = unit.Position;
+					unit.MoveToAsync(unitInfo.MoveInfo.Points).Coroutine();
 				}
 	        }
 

+ 1 - 6
Unity/Assets/Scripts/Codes/Hotfix/Server/Demo/Scenes/Map/Move/MoveHelper.cs

@@ -1,5 +1,4 @@
 using System.Collections.Generic;
-using System.Numerics;
 using Unity.Mathematics;
 
 namespace ET.Server
@@ -27,12 +26,8 @@ namespace ET.Server
             }
                 
             // 广播寻路路径
-            M2C_PathfindingResult m2CPathfindingResult = new M2C_PathfindingResult() {Points = new List<float3>()};
+            M2C_PathfindingResult m2CPathfindingResult = new M2C_PathfindingResult() { Points = list };
             m2CPathfindingResult.Id = unit.Id;
-            for (int i = 0; i < list.Count; ++i)
-            {
-                m2CPathfindingResult.Points = list;
-            }
             MessageHelper.Broadcast(unit, m2CPathfindingResult);
 
             bool ret = await unit.GetComponent<MoveComponent>().MoveToAsync(list, speed);

+ 3 - 2
Unity/Assets/Scripts/Codes/Hotfix/Server/Demo/Scenes/Map/Unit/UnitHelper.cs

@@ -22,11 +22,12 @@ namespace ET.Server
             {
                 if (!moveComponent.IsArrived())
                 {
-                    unitInfo.MoveInfo = new MoveInfo();
+                    unitInfo.MoveInfo = new MoveInfo() { Points = new List<float3>() };
+                    unitInfo.MoveInfo.Points.Add(unit.Position);
                     for (int i = moveComponent.N; i < moveComponent.Targets.Count; ++i)
                     {
                         float3 pos = moveComponent.Targets[i];
-                        unitInfo.MoveInfo.Position.Add(pos);
+                        unitInfo.MoveInfo.Points.Add(pos);
                     }
                 }
             }

+ 20 - 26
Unity/Assets/Scripts/Codes/HotfixView/Client/Demo/Opera/OperaComponentSystem.cs

@@ -20,36 +20,30 @@ namespace ET.Client
         {
             protected override void Update(OperaComponent self)
             {
-                self.Update();
-            }
-        }
-        
-        public static void Update(this OperaComponent self)
-        {
-            if (Input.GetMouseButtonDown(1))
-            {
-                Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
-                RaycastHit hit;
-                if (Physics.Raycast(ray, out hit, 1000, self.mapMask))
+                if (Input.GetMouseButtonDown(1))
                 {
-                    self.ClickPoint = hit.point;
-                    C2M_PathfindingResult c2MPathfindingResult = new C2M_PathfindingResult();
-                    c2MPathfindingResult.Position = self.ClickPoint;
-                    self.ClientScene().GetComponent<SessionComponent>().Session.Send(c2MPathfindingResult);
+                    Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
+                    RaycastHit hit;
+                    if (Physics.Raycast(ray, out hit, 1000, self.mapMask))
+                    {
+                        C2M_PathfindingResult c2MPathfindingResult = new C2M_PathfindingResult();
+                        c2MPathfindingResult.Position = hit.point;
+                        self.ClientScene().GetComponent<SessionComponent>().Session.Send(c2MPathfindingResult);
+                    }
                 }
-            }
 
-            if (Input.GetKeyDown(KeyCode.R))
-            {
-                CodeLoader.Instance.LoadHotfix();
-                EventSystem.Instance.Load();
-                Log.Debug("hot reload success!");
-            }
+                if (Input.GetKeyDown(KeyCode.R))
+                {
+                    CodeLoader.Instance.LoadHotfix();
+                    EventSystem.Instance.Load();
+                    Log.Debug("hot reload success!");
+                }
             
-            if (Input.GetKeyDown(KeyCode.T))
-            {
-                C2M_TransferMap c2MTransferMap = new C2M_TransferMap();
-                self.ClientScene().GetComponent<SessionComponent>().Session.Call(c2MTransferMap).Coroutine();
+                if (Input.GetKeyDown(KeyCode.T))
+                {
+                    C2M_TransferMap c2MTransferMap = new C2M_TransferMap();
+                    self.ClientScene().GetComponent<SessionComponent>().Session.Call(c2MTransferMap).Coroutine();
+                }
             }
         }
     }

+ 1 - 1
Unity/Assets/Scripts/Codes/Model/Generate/Client/Message/OuterMessage_C_10001.cs

@@ -120,7 +120,7 @@ namespace ET
 	public partial class MoveInfo: ProtoObject
 	{
 		[ProtoMember(1)]
-		public List<Unity.Mathematics.float3> Position;
+		public List<Unity.Mathematics.float3> Points;
 
 		[ProtoMember(2)]
 		public Unity.Mathematics.quaternion Rotation { get; set; }

+ 1 - 1
Unity/Assets/Scripts/Codes/Model/Generate/ClientServer/Message/OuterMessage_C_10001.cs

@@ -120,7 +120,7 @@ namespace ET
 	public partial class MoveInfo: ProtoObject
 	{
 		[ProtoMember(1)]
-		public List<Unity.Mathematics.float3> Position;
+		public List<Unity.Mathematics.float3> Points;
 
 		[ProtoMember(2)]
 		public Unity.Mathematics.quaternion Rotation { get; set; }

+ 1 - 1
Unity/Assets/Scripts/Codes/Model/Generate/Server/Message/OuterMessage_C_10001.cs

@@ -120,7 +120,7 @@ namespace ET
 	public partial class MoveInfo: ProtoObject
 	{
 		[ProtoMember(1)]
-		public List<Unity.Mathematics.float3> Position;
+		public List<Unity.Mathematics.float3> Points;
 
 		[ProtoMember(2)]
 		public Unity.Mathematics.quaternion Rotation { get; set; }