ybx_Gdn 1 rok temu
rodzic
commit
e7e068826c

+ 1 - 1
Assets/Lua/Config/GMCfg.lua

@@ -32,7 +32,7 @@ local GMCfg = {
 [10006]={
 ['GMID']=10006,
 ['Code']='sethardmap-1-1',
-['SortIndex']=2,
+['SortIndex']=6,
 ['Name']='跳地圖[困難]',
 },
 }

+ 2 - 2
Assets/Lua/Managers/LuaBattleMgr.lua

@@ -1336,7 +1336,7 @@ end
 
 -- 完成主角创建
 function LuaBattleMgr:CreateRoleViewComplete(gameObject)
-    ManagerContainer.LuaGameMgr:CreateRoleViewComplete(gameObject)
+    ManagerContainer.LuaGameMgr:CreateRoleViewComplete(gameObject,1)
 end
 
 -- 通知战斗需要更新主角新形象
@@ -1361,7 +1361,7 @@ end
 -- 完成主角形象更新
 function LuaBattleMgr:RefreshRoleViewComplete(gameObject, isNewModel)
     self.waitingRefreshRole = false
-    ManagerContainer.LuaGameMgr:RefreshRoleViewComplete(gameObject, isNewModel)
+    ManagerContainer.LuaGameMgr:RefreshRoleViewComplete(gameObject, isNewModel,1)
 
     self:NotifyLoadingStatusEnd(Enum.BattleBtnState.RoleModel)
 end

+ 13 - 2
Assets/Src/GameLogic/Battle/BattleSystemNew.cs

@@ -2280,20 +2280,31 @@ public class BattleMgr : SingletonMono<BattleMgr>
         mLuaBattleMgr.CallCS2Lua("CreateRoleView");
     }
 
-    public void OnLoadRoleCompleted(GameObject go, bool bRefresh, bool isNew)
+    public void OnLoadRoleCompleted(GameObject go, bool bRefresh, bool isNew,int roleId = 1)
     {
         bLoadingRoleModel = false;
         bHasLoadedRole = true;
         mRoleModelGo = go;
         if (bRefresh && isNew && mBattle != null)
         {
-            var f = mBattle.FighterMgr.GetTeamMemberById(1);
+            var f = mBattle.FighterMgr.GetTeamMemberById(roleId);
             if (f.Ctrl != null)
                 f.Ctrl.RebindAvatarGo(go);
 
             mBattle.MoveToNextBattleField(false);
             f.Ctrl.Animator.Play(FighterAnimatorHash.StateRun);
         }
+
+        //for (int i =2; i < 7; i++)
+        //{
+        //    GameObject ngo = Instantiate<GameObject>(go);
+        //    var f = mBattle.FighterMgr.GetTeamMemberById(i);
+        //    if (f.Ctrl != null)
+        //        f.Ctrl.RebindAvatarGo(ngo);
+
+        //    mBattle.MoveToNextBattleField(false);
+        //    f.Ctrl.Animator.Play(FighterAnimatorHash.StateRun);
+        //}
     }
 
     public void NotifyRefreshRoleView()

+ 4 - 4
Assets/Src/GameLogic/GameMgr.cs

@@ -550,18 +550,18 @@ public class GameMgr : SingletonMono<GameMgr>
     /// 完成角色创建
     /// </summary>
     /// <param name="modelGo"></param>
-    public void CreateRoleViewComplete(GameObject modelGo)
+    public void CreateRoleViewComplete(GameObject modelGo, int roleId = 1)
     {
-        BattleMgr.Instance.OnLoadRoleCompleted(modelGo, false, false);
+        BattleMgr.Instance.OnLoadRoleCompleted(modelGo, false, false, roleId);
     }
 
     /// <summary>
     /// 角色形象更新完成
     /// </summary>
     /// <param name="modelGo"></param>
-    public void RefreshRoleViewComplete(GameObject modelGo, bool isNew)
+    public void RefreshRoleViewComplete(GameObject modelGo, bool isNew, int roleId = 1)
     {
-        BattleMgr.Instance.OnLoadRoleCompleted(modelGo, true, isNew);
+        BattleMgr.Instance.OnLoadRoleCompleted(modelGo, true, isNew, roleId);
     }
 
     /// <summary>

+ 7 - 5
Assets/ToLua/Source/Generate/GameMgrWrap.cs

@@ -1,4 +1,4 @@
-//this source code was auto-generated by tolua#, do not modify it
+//this source code was auto-generated by tolua#, do not modify it
 using System;
 using LuaInterface;
 
@@ -281,10 +281,11 @@ public class GameMgrWrap
 	{
 		try
 		{
-			ToLua.CheckArgsCount(L, 2);
+			ToLua.CheckArgsCount(L, 3);
 			GameMgr obj = (GameMgr)ToLua.CheckObject<GameMgr>(L, 1);
 			UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.CheckObject(L, 2, typeof(UnityEngine.GameObject));
-			obj.CreateRoleViewComplete(arg0);
+			int arg1 = LuaDLL.luaL_checkinteger(L, 3);
+			obj.CreateRoleViewComplete(arg0,arg1);
 			return 0;
 		}
 		catch (Exception e)
@@ -298,11 +299,12 @@ public class GameMgrWrap
 	{
 		try
 		{
-			ToLua.CheckArgsCount(L, 3);
+			ToLua.CheckArgsCount(L, 4);
 			GameMgr obj = (GameMgr)ToLua.CheckObject<GameMgr>(L, 1);
 			UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.CheckObject(L, 2, typeof(UnityEngine.GameObject));
 			bool arg1 = LuaDLL.luaL_checkboolean(L, 3);
-			obj.RefreshRoleViewComplete(arg0, arg1);
+			int arg2 = LuaDLL.luaL_checkinteger(L, 4);
+			obj.RefreshRoleViewComplete(arg0, arg1,arg2);
 			return 0;
 		}
 		catch (Exception e)