/// <summary> ///加载数据 /// </summary> public void SetContent(TalentTypeVO talentTypeVO) { PlayerInfoVo playerInfoVo = NetworkManager.Instance.GetPlayerController().GetPlayerInfo(); m_NameLabel.text = TableUtil.GetTalentName(talentTypeVO.Id); //UIUtil.SetIconImageSquare(m_IconImage, talentTypeVO.IconId); m_CoinLabel.text = CurrencyUtil.GetTalentCurrencyCount().ToString(); m_LevelLabel.text = string.Format(TableUtil.GetLanguageString("character_text_1019"), playerInfoVo.WatchLv); talentTypeVO.Level = (int)playerInfoVo.WatchLv; Vector3 vector3 = new Vector3((float)talentTypeVO.MTalent.Value.Position.Value.X, (float)talentTypeVO.MTalent.Value.Position.Value.Y, 0); SetPos(vector3); }
/// <summary> /// 显示手表升级提示 /// </summary> private void ShowUpaTips() { PlayerInfoVo player = NetworkManager.Instance.GetPlayerController().GetPlayerInfo(); double exp = m_CfgEternityProxy.GetPlayerUpa(player.WatchLv).Exp; if (player.WatchExp >= exp && exp > 0) { m_UpaTips.gameObject.SetActive(true); } else { m_UpaTips.gameObject.SetActive(false); } }
public void OnInteracted() { MissionProxy missionProxy = GameFacade.Instance.RetrieveProxy(ProxyName.MissionProxy) as MissionProxy; LookAtMainPlayerOnInteraction(); if (m_TeleportId > 0) { //手表升级传送等级限制 if (m_NpcTmpVO.Function.HasValue && m_NpcTmpVO.Function.Value.Type == 5) { //可升级进行传送 PlayerInfoVo player = NetworkManager.Instance.GetPlayerController().GetPlayerInfo(); double exp = m_CfgEternityProxy.GetPlayerUpa(player.WatchLv).Exp; if (player.WatchExp >= exp && exp > 0) { NetworkManager.Instance.GetSceneController().SwitchMap((uint)m_TeleportId); } else { //经验值不足提示 DialogueInfo info = new DialogueInfo(); info.DialogueTid = (uint)(exp > 0 ? 510000 : 510001); info.SoundParent = transform; info.NpcTid = m_NpcTmpVO.Id; info.NeedSendToServer = false; GameFacade.Instance.SendNotification(NotificationName.MSG_DIALOGUE_SHOW, info); SetFocus(true); } } else { //切地图 NetworkManager.Instance.GetSceneController().SwitchMap((uint)m_TeleportId); } } else if (missionProxy.OpenMissionPanel(GetUId(), m_NpcTmpVO, transform)) { SetFocus(true); return; } else if (m_NpcTmpVO.Function.HasValue && !string.IsNullOrEmpty(m_NpcTmpVO.Function.Value.Arg1)) { if (Enum.TryParse(m_NpcTmpVO.Function.Value.Arg1, out UIPanel panelName)) { if (m_NpcTmpVO.Function.Value.Arg3 > 0) { UIManager.Instance.OpenPanel(panelName, m_NpcTmpVO.Function.Value.Arg3); } else { UIManager.Instance.OpenPanel(panelName); } } SetFocus(true); } else if (m_NpcTmpVO.Function.HasValue && m_NpcTmpVO.Function.Value.Type == 4) { NetworkManager.Instance.GetPlayerController().RequestLevelUpWatch(); SetFocus(true); } else if (m_NpcTmpVO.Function.HasValue && m_NpcTmpVO.Function.Value.Arg2Length > 0) { missionProxy.OpenNpcChat(m_NpcTmpVO, transform, 0, m_NpcTmpVO.Id); SetFocus(true); } }
/// <summary> /// 设置天赋状态 /// </summary> /// <param name="talentVO"></param> public void SetTalentState(TalentVO talentVO) { if (talentVO == null) { return; } if (talentVO.Level == 0) { talentVO.State = TalentState.NoActivate; } bool talentrootMeet = true; bool talentMeet = true; PlayerInfoVo playerInfoVo = NetworkManager.Instance.GetPlayerController().GetPlayerInfo(); #region 判读激活 // Debug.Log(talentVO.Id+"--------------" + talentVO.UnLockId); if (talentVO.UnLockId > 0) { EffectElement?[] effectElements = m_CfgEternityProxy.GetEffectElementsByKey((uint)talentVO.UnLockId); for (int i = 0; i < effectElements.Length; i++) { OperationType fun = (OperationType)effectElements[i].Value.Function; switch (fun) { case OperationType.kGreaterAndEqual: if (effectElements[i].Value.Attribute == (int)AttributeName.kDuanLevel) { if (playerInfoVo.Exp < effectElements[i].Value.Value) { talentMeet = false; } } if (effectElements[i].Value.Attribute == (int)AttributeName.kRoleLevel) { if (playerInfoVo.Level < effectElements[i].Value.Value) { talentMeet = false; } } break; case OperationType.kGreater: if (effectElements[i].Value.Attribute == (int)AttributeName.kDuanLevel) { if (playerInfoVo.Exp <= effectElements[i].Value.Value) { talentMeet = false; } } if (effectElements[i].Value.Attribute == (int)AttributeName.kRoleLevel) { if (playerInfoVo.Level <= effectElements[i].Value.Value) { talentMeet = false; } } break; default: break; } } } // EffectElement?[] effectElementRoots = m_CfgEternityProxy.GetEffectElementsByKey((uint)talentVO.MTalentTypeVO.UnLockId); //for (int i = 0; i < effectElementRoots.Length; i++) //{ // OperationType fun = (OperationType)effectElementRoots[i].Value.Function; // switch (fun) // { // case OperationType.kGreaterAndEqual://反向判段 // if (effectElementRoots[i].Value.Attribute == (int)AttributeName.kDuanLevel) // { // if (playerInfoVo.Exp < effectElementRoots[i].Value.Value) // { // talentrootMeet = false; // } // } // if (effectElementRoots[i].Value.Attribute == (int)AttributeName.kRoleLevel) // { // if (playerInfoVo.Level < effectElementRoots[i].Value.Value) // { // talentrootMeet = false; // } // } // break; // case OperationType.kGreater: // if (effectElementRoots[i].Value.Attribute == (int)AttributeName.kDuanLevel) // { // if (playerInfoVo.Exp <= effectElementRoots[i].Value.Value) // { // talentrootMeet = false; // } // } // if (effectElementRoots[i].Value.Attribute == (int)AttributeName.kRoleLevel) // { // if (playerInfoVo.Level <= effectElementRoots[i].Value.Value) // { // talentrootMeet = false; // } // } // break; // default: // break; // } //} #endregion if (m_TalentVODic.TryGetValue((uint)talentVO.BackNodeId, out TalentVO vO)) { if (vO.Level >= 1 && talentrootMeet && talentMeet)//前置等于1 { talentVO.State = TalentState.CanActivate; } } if ((uint)talentVO.BackNodeId == 0) { talentVO.State = TalentState.CanActivate; } if (talentVO.Level >= 1) { talentVO.State = TalentState.Activate; } if (talentVO.Level == talentVO.MaxLevel) { talentVO.State = TalentState.FullLevel; } }