| | |
| | | public static void UpdateBattleField(H0418_tagObjInfoRefresh vNetData) |
| | | { |
| | | BattleField battleField = BattleManager.Instance.GetBattleField(vNetData.packUID); |
| | | if (null != battleField) |
| | | battleField.ObjInfoRefresh(vNetData); |
| | | } |
| | | } |
| | |
| | | // Len; |
| | | // Msg; //size = Len |
| | | JsonData extendData = JsonMapper.ToObject(vNetData.Msg); |
| | | if (battleField != null) |
| | | { |
| | | battleField.OnTurnFightState(vNetData.TurnNum, vNetData.State, (int)vNetData.FuncLineID, extendData); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | // 战报结果 |
| | | string guid = UIHelper.ServerStringTrim(vNetData.GUID); |
| | | |
| | | Debug.LogError("guid is " + guid); |
| | | //约定 B430 内容(小包1长度WORD + 包1 + 小包2长度WORD + 包2) |
| | | try |
| | | { |
| | |
| | | protected set; |
| | | } |
| | | |
| | | public bool rejectNewPackage = false; |
| | | |
| | | private bool m_IsPause = false; |
| | | |
| | | public bool IsPause |
| | |
| | | SetSpeedRatio(BattleManager.Instance.speedGear[BattleManager.Instance.speedIndex]); |
| | | } |
| | | SetRootNodePosition(); |
| | | rejectNewPackage = false; |
| | | } |
| | | |
| | | public void SetSpeedRatio(float ratio) |
| | |
| | | { |
| | | //已经结束并结算 |
| | | Debug.Log("战斗结束"); |
| | | rejectNewPackage = true; |
| | | OnBattleEnd(turnFightStateData); |
| | | return; |
| | | } |
| | |
| | | { |
| | | uidList.Add(packUID); |
| | | } |
| | | |
| | | } |
| | | |
| | | public BattleField GetBattleField(ulong packUID) |
| | | { |
| | | return GetBattleField(GetGUID(packUID)); |
| | | string guid = GetGUID(packUID); |
| | | BattleField battleField = GetBattleField(GetGUID(packUID)); |
| | | if (battleField == null || battleField.rejectNewPackage) |
| | | { |
| | | return null; |
| | | } |
| | | return battleField; |
| | | } |
| | | |
| | | public BattleField GetBattleField(string guid) |
| | |
| | | return; |
| | | } |
| | | |
| | | if (queue.Count <= 0) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | var pack = queue.Dequeue(); |
| | | |
| | | // Debug.LogError("DistributeNextReportPackage for guid : " + guid + " pack type : " + pack.GetType()); |
| | |
| | | catch (Exception ex) |
| | | { |
| | | Debug.LogError("DistributeNextPackage: 分发包异常 " + ex); |
| | | // 出错时主动移除当前包,防止死循环 |
| | | if (packQueue.Count > 0) |
| | | { |
| | | packQueue.Dequeue(); |
| | | } |
| | | } |
| | | |
| | | if (queue.Count <= 0) |
| | |
| | | this.bulletEffect = bulletEffect; |
| | | this.target = target; |
| | | this.onHit = onHit; |
| | | this.bulletTrans = bulletEffect.transform as RectTransform; |
| | | this.bulletTrans = bulletEffect.rectTrans; |
| | | this.hurts = hurtList; |
| | | this.mBulletIndex = bulletIndex; |
| | | |
| | |
| | | throw new System.Exception("hero id and skin id are both invalid, npc id is invalid too (all <= 0)"); |
| | | } |
| | | |
| | | if (fightObj.NPCID > 0) |
| | | { |
| | | NPCConfig npcConfig = NPCConfig.Get((int)fightObj.NPCID); |
| | | if (null != npcConfig) |
| | | { |
| | | modelScale = npcConfig.ModelScale; |
| | | } |
| | | } |
| | | |
| | | level = (int)fightObj.LV; |
| | | |
| | | skinConfig = HeroSkinConfig.Get(SkinID); |