| | |
| | | |
| | | public float modelScale = 1f; |
| | | |
| | | public int level = 0; |
| | | |
| | | public TeamBase teamBase |
| | | { |
| | |
| | | } |
| | | public int positionNum; //注意服务端的1号位是1,客户端在使用时是0,通信和策划沟通用1 |
| | | |
| | | // 战场数据 |
| | | |
| | | |
| | | // 战场数据 |
| | | public int ObjID = 0;// 战斗单位唯一ID |
| | | |
| | | public int NPCID = 0;// 战斗NPCID,不同的实例ID对应的NPCID可能一样 |
| | |
| | | // 判断一下是npc还是玩家 |
| | | heroId = (int)fightObj.HeroID; |
| | | |
| | | if (fightObj.NPCID > 0) |
| | | // B4 24 回合战斗初始化 #tagSCTurnFightInit |
| | | // 封包中的 HeroID、SkinID 字段不再是玩家阵容独有,NPC阵容也可能有值,一般是关联武将的NPC有值 |
| | | // 如果 HeroID、SkinID 不为空,则可认为是关联武将的NPC,外观相关默认通过HeroID读取武将相关,如名称 |
| | | // 皮肤 SkinID 不为空时,则模型默认使用该皮肤 |
| | | // 如果 HeroID、SkinID 为空, NPCID不为空,则走原NPC默认规则 |
| | | |
| | | // 补充 skinid跟heroid要么同时没有 要么同时有 如果这三个id都没有的话 那就是配置严重错误 无法弥补 |
| | | |
| | | if (fightObj.SkinID > 0 && fightObj.HeroID > 0) |
| | | { |
| | | // 走玩家逻辑 |
| | | var heroConfig = HeroConfig.Get(heroId); |
| | | if (null == heroConfig) |
| | | { |
| | | Debug.LogError("hero config is null, heroId : " + heroId); |
| | | return; |
| | | } |
| | | Country = (HeroCountry)heroConfig.Country; |
| | | SkinID = (int)fightObj.SkinID; |
| | | modelScale = 1f; |
| | | } |
| | | else if (fightObj.NPCID > 0) |
| | | { |
| | | //走NPC的逻辑 |
| | | NPCConfig npcConfig = NPCConfig.Get((int)fightObj.NPCID); |
| | | Country = (HeroCountry)npcConfig.Country; |
| | | SkinID = npcConfig.SkinID; |
| | | BattleDebug.LogError("npc skin id is " + SkinID); |
| | | modelScale = npcConfig.ModelScale; |
| | | } |
| | | else |
| | | { |
| | | //走玩家逻辑 |
| | | var heroConfig = HeroConfig.Get(heroId); |
| | | Country = (HeroCountry)heroConfig.Country; |
| | | SkinID = (int)fightObj.SkinID; |
| | | BattleDebug.LogError("normal hero skin id is " + SkinID); |
| | | modelScale = 1f; |
| | | throw new System.Exception("hero id and skin id are both invalid, npc id is invalid too (all <= 0)"); |
| | | } |
| | | |
| | | level = (int)fightObj.LV; |
| | | |
| | | skinConfig = HeroSkinConfig.Get(SkinID); |
| | | teamBase = _teamBase; |