public int FieldType = 0; //战场什么类型 public override void Initialize(Config config) { Instance.Api = new LTLegionWarApi(); Instance.Api.ErrorHandler += ErrorHandler; LegionRankList = GameDataSparxManager.Instance.Register <WarLegionRankList>(LegionRankListDataId); QualifyEnemyList = GameDataSparxManager.Instance.Register <FlowEnemyList>(QualifyEnemyListDataId); PersonRankList = GameDataSparxManager.Instance.Register <WarPersonRankList>(PersonRankListDataId); FinalPlayerDataList = GameDataSparxManager.Instance.Register <FinalPlayerList>(FinalPlayerDataListId); FinalStatusList = GameDataSparxManager.Instance.Register <FinalStatusList>(FinalStatusListId); WatchLogList = new WatchLogList(); SemiOrFinalLegionList = new SemiOrFinalJoinList(); }
/// <summary> /// 显示各个战场参加人数 /// </summary> /// <param name="pushList"></param> public void SetJoinPeopleCount(FinalPlayerList pushList) { int UsCount = 0; int EnemyCount = 0; for (int i = 0; i < 3; i++) { int num = 0; for (var j = 0; j < pushList.AllHomeTeam[i].Count; j++) { var item = pushList.AllHomeTeam[i][j]; if (item != null && !string.IsNullOrEmpty(item.Name)) { if (Legions[0].id == LTLegionWarManager.Instance.HomeTeamAid) { num++; UsCount++; } else { EnemyCount++; } } } for (var j = 0; j < pushList.AllAwayTeam[i].Count; j++) { var item = pushList.AllAwayTeam[i][j]; if (item != null && !string.IsNullOrEmpty(item.Name)) { if (!(Legions[0].id == LTLegionWarManager.Instance.HomeTeamAid)) { num++; UsCount++; } else { EnemyCount++; } } } NumLabel[i].text = NumLabel[i].transform.GetChild(0).GetComponent <UILabel>().text = string.Format("{0}/5", num); } UsCell.WaitState.GetComponent <UILabel>().text = UsCell.WaitState.transform.GetChild(0).GetComponent <UILabel>().text = UsCount.ToString(); EnemyCell.WaitState.GetComponent <UILabel>().text = EnemyCell.WaitState.transform.GetChild(0).GetComponent <UILabel>().text = EnemyCount.ToString(); }
private void allianceBattleSemiAndFinalPlayers(object payload) { Hashtable data = payload as Hashtable; Hashtable data1 = data["battleField"] as Hashtable; ArrayList data3 = data["semiOrFinalStatus"] as ArrayList; LTLegionWarManager.Instance.FinalStatusList.OnUpdate(data3); if (Hotfix_LT.EBCore.Dot.Array("battleField", data1, null) != null) { ArrayList data2 = data1["battleField"] as ArrayList; FinalPlayerList pushList = new FinalPlayerList(); if (LTLegionWarFinalController.Instance != null) { pushList.OnUpdate(data2); LTLegionWarFinalController.Instance.SetJoinPeopleCount(pushList); int field = (int)(LTLegionWarFinalController.Instance.WarFiled); if (field >= 0 && field < 3) { for (int i = pushList.AllHomeTeam[field].Count; i < 5; i++) { pushList.AllHomeTeam[field].Add(new FinalPlayerData()); } for (int i = pushList.AllAwayTeam[field].Count; i < 5; i++) { pushList.AllAwayTeam[field].Add(new FinalPlayerData()); } for (int i = 0; i < 5; i++) { if (pushList.AllHomeTeam[field][i].Name != FinalPlayerDataList.AllHomeTeam[field][i].Name) { FinalPlayerDataList.AllHomeTeam[field][i] = pushList.AllHomeTeam[field][i]; if (LTLegionWarFinalController.Legions[0].id == HomeTeamAid) { LTLegionWarFinalController.Instance.UsFinalItems[i].SetData(pushList.AllHomeTeam[field][i]); LTLegionWarFinalController.Instance.UsFinalItems[i].StartBootFlash(); } else { LTLegionWarFinalController.Instance.EnemyFinalItems[i].SetData(pushList.AllHomeTeam[field][i]); LTLegionWarFinalController.Instance.EnemyFinalItems[i].StartBootFlash(); } } if (pushList.AllAwayTeam[field][i].Name != FinalPlayerDataList.AllAwayTeam[field][i].Name) { FinalPlayerDataList.AllAwayTeam[field][i] = pushList.AllAwayTeam[field][i]; if (LTLegionWarFinalController.Legions[0].id != HomeTeamAid) { LTLegionWarFinalController.Instance.UsFinalItems[i].SetData(pushList.AllAwayTeam[field][i]); LTLegionWarFinalController.Instance.UsFinalItems[i].StartBootFlash(); } else { LTLegionWarFinalController.Instance.EnemyFinalItems[i].SetData(pushList.AllAwayTeam[field][i]); LTLegionWarFinalController.Instance.EnemyFinalItems[i].StartBootFlash(); } } } } FinalPlayerDataList.OnUpdate(data2); } } }