/// <summary> /// 开局前刷新对手信息,没有箭头,适用于对战或挑战的匹配前,匹配后 /// </summary> public void RefreshRivalInfoBeforeRound(float countDown) { if (CommonData.RivalUser == null) { Debug.LogError("此时不能没有RivalUser"); return; } GrpRealFighting.SetActive(true); GrpPushLevel.SetActive(false); GrpBeforeMatch.SetActive(false); LblRivalNickname.text = CommonData.RivalUser.Nickname; LblRivalLevel.text = CommonData.RivalUser.Level.ToString(CultureInfo.InvariantCulture); LblHealth.text = CommonData.RivalUser.RoundInitHealth.ToString(CultureInfo.InvariantCulture); LblEnergyCapacity.text = CommonData.RivalUser.EnergyCapacity.ToString(CultureInfo.InvariantCulture); LblRivalReputation.text = "积分:";//TODO:User没有这个信息 LblRivalGlobalRank.text = "全球排名:"; foreach (var character in RivalCharacterList) { character.ClearToEmpty(); character.gameObject.SetActive(false); } RivalSingleCharacter.gameObject.SetActive(true); RivalSingleCharacter.CharacterCode = CommonData.RivalUser.CharacterCode; RivalSingleCharacter.Refresh(); BtnCancelMatch.isEnabled = false; StartCoroutine(CountDown(countDown)); }
/// <summary> /// 匹配前 /// </summary> public void RefreshBeforeMatch() { LblMatching.text = string.Format("正在匹配对手\n今日还剩{0}次挑战次数", Random.Range(1, 21)); GrpRealFighting.SetActive(true); GrpBeforeMatch.SetActive(true); GrpPushLevel.SetActive(false); //2.刷新对手信息 LblRivalNickname.text = null; LblRivalLevel.text = null; LblHealth.text = null; LblEnergyCapacity.text = null; LblRivalReputation.text = null; LblRivalGlobalRank.text = null; RivalSingleCharacter.ClearToEmpty(); //ArrowRivalReputation.SetActive(false); //ArrowRivalGlobalRank.SetActive(false); //3.WaitHint var waitHintTextConfig = ConfigManager.GetConfig(ConfigManager.ConfigType.WaitHintTextConfig) as WaitHintTextConfig; if (waitHintTextConfig != null && waitHintTextConfig.HintList != null && waitHintTextConfig.HintList.Count > 0) { LblWaitHint.text = waitHintTextConfig.HintList[Random.Range(0, waitHintTextConfig.HintList.Count)]; } else { LblWaitHint.text = null; } //4.按钮 BtnReturn.SetActive(false); BtnNewMatch.gameObject.SetActive(false); BtnReMatch.gameObject.SetActive(false); LblButton.text = "取消匹配"; BtnCancelMatch.isEnabled = true; //5.技能栏 SkillIconTemplate.SetActive(false); }
/// <summary> /// 挑战局,匹配后状态,之前没调用过ResetAndRefreshMyInfo()所以不用再刷新别的东西 /// </summary> public void RefreshBeforeChallenge() { //0.切换用途 GrpPushLevel.SetActive(true); GrpRealFighting.SetActive(false); //1.刷新我的信息 //2.刷新敌人信息 if (GameData.RivalBossData != null) { if (GameData.RivalBossData == null) { Debug.LogError("没有对方Boss数据"); } else { LblRivalNickname.text = GameData.RivalBossData.Nickname; if (GameData.FellowDataList == null || GameData.FellowDataList.Count == 0) { foreach (var character in RivalCharacterList) { character.ClearToEmpty(); character.gameObject.SetActive(false); } RivalSingleCharacter.gameObject.SetActive(true); RivalSingleCharacter.CharacterCode = GameData.RivalBossData.Character; RivalSingleCharacter.Refresh(); RivalSingleCharacter.WearEquip(GameData.RivalBossData.WearEquipList); } else { RivalSingleCharacter.ClearToEmpty(); RivalSingleCharacter.gameObject.SetActive(false); for (int i = 0; i < RivalCharacterList.Length; i++) { var character = RivalCharacterList[i]; if (i == 0) { character.gameObject.SetActive(true); character.CharacterCode = GameData.RivalBossData.Character; character.Refresh(); character.WearEquip(GameData.RivalBossData.WearEquipList); } else { if (i - 1 < GameData.FellowDataList.Count) { character.gameObject.SetActive(true); character.CharacterCode = GameData.FellowDataList[i - 1].Character; character.Refresh(); } else { character.ClearToEmpty(); } } } } } //3.拥有技能 var skillCodeList = new List <SkillEnum>(); var skillLevelList = new List <int>(); foreach (var useSkillEvent in GameData.RivalBossData.SkillEventList) { if (!skillCodeList.Contains((SkillEnum)useSkillEvent.SkillCode)) { skillCodeList.Add((SkillEnum)useSkillEvent.SkillCode); skillLevelList.Add(useSkillEvent.SkillLevel); } } RefreshSkillGrid(skillCodeList, skillLevelList); } if (GameData.LastSubLevelData.CanTeam) { GrpCanTeam.SetActive(true); GrpCannotTeam.SetActive(false); RefreshReinforce();//刷新增援信息 } else { GrpCannotTeam.SetActive(true); GrpCanTeam.SetActive(false); } }