Browse Source

fix相机还未扫完场景,战斗已开始的问题

大爷 1 year ago
parent
commit
32a6b92d58

+ 1 - 1
Unity/Assets/Scripts/Codes/Hotfix/Client/Login/EnterMapHelper.cs

@@ -26,7 +26,7 @@ namespace ET.Client
 
                 SceneChangeHelper.SceneChangeTo(clientScene, mapinfo, g2CEnterMap.MapInstanceId).Coroutine();
                 // 等待场景切换完成
-                var task =  clientScene.GetComponent<ObjectWait>().Wait<Wait_SceneChangeFinish>();
+                await clientScene.GetComponent<ObjectWait>().Wait<Wait_SceneChangeFinish>();
 
                 Log.Debug("tell bat svr i'm ready.");
                 //告诉战斗服 i am ready

+ 1 - 1
Unity/Assets/Scripts/Codes/HotfixView/Client/Camera/CameraMgr.cs

@@ -36,7 +36,7 @@ namespace ET.Client
             return Camera.main.transform.position;
         }
 
-        public static void DragCamera(Vector3 start, Vector3 end, float duration, System.Action endcb)
+        public static void DragMe(Vector3 start, Vector3 end, float duration, System.Action endcb)
         {
             Transform trans = GlobalViewComponent.Instance.BattleCamera.transform;
             trans.position = start;

+ 3 - 3
Unity/Assets/Scripts/Codes/HotfixView/Client/Scene/SceneChangeStart_AddComponent.cs

@@ -27,9 +27,9 @@ namespace ET.Client
             // 通知等待场景切换的协程
             EventSystem.Instance.Publish<EventType.SceneLoadFinish>();
 
-            Vector3 StartPos = new(30, 30, 0);
-            Vector3 EndPos = new(230, 30, 0);
-            CameraMgr.DragCamera(StartPos, EndPos, 7, () =>
+            Vector3 StartPos = new(30, 15, 10);
+            Vector3 EndPos = new(230, 15, 10);
+            CameraMgr.DragMe(StartPos, EndPos, 8, () =>
             {
                 Log.Debug("camera scroll end");
                 scene.GetComponent<ObjectWait>().Notify(new Wait_SceneChangeFinish());

+ 1 - 1
Unity/Assets/Scripts/Codes/HotfixView/Client/Unit/UnitRenderSystem.cs

@@ -24,7 +24,7 @@ namespace ET.Client
             if (component.AniData == null)
             {
                 var unit = UnitMgr.Instance.GetUnit(args.UnitId);
-                Log.Error($"UnitRender({unit?.ZoneObject}) not contains AnimationData component");
+                Log.Error($"UnitRender({component.GameObject.name}) not contains AnimationData component");
                 return;
             }