private void UpdateNobeIcon() { CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(FORM_PATH); CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (((form != null) && form.gameObject.activeSelf) && (masterRoleInfo != null)) { GameObject widget = form.GetWidget(2); if (widget != null) { CUIHttpImageScript component = widget.GetComponent <CUIHttpImageScript>(); MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(component.GetComponent <Image>(), (int)masterRoleInfo.GetNobeInfo().stGameVipClient.dwCurLevel, false); Image image = form.GetWidget(3).GetComponent <Image>(); MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(image, (int)masterRoleInfo.GetNobeInfo().stGameVipClient.dwHeadIconId); } } }
public void UpdatePlayerData() { CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo(); if (masterRoleInfo != null) { CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(FORM_PATH); if (this.m_PlayerName != null) { this.m_PlayerName.text = masterRoleInfo.Name; } if (this.m_PlayerExp != null) { this.m_PlayerExp.text = masterRoleInfo.Level.ToString(); } if ((masterRoleInfo != null) && (this.m_PvpExpImg != null)) { this.m_PvpExpImg.CustomFillAmount(CPlayerProfile.Divide(masterRoleInfo.PvpExp, masterRoleInfo.PvpNeedExp)); this.m_PvpExpTxt.text = masterRoleInfo.PvpExp + "/" + masterRoleInfo.PvpNeedExp; } if (this.m_PvpLevel != null) { string text = Singleton <CTextManager> .GetInstance().GetText("ranking_PlayerLevel"); if ((!string.IsNullOrEmpty(text) && (this.m_PvpLevel.text != null)) && (masterRoleInfo != null)) { this.m_PvpLevel.text = string.Format(text, masterRoleInfo.PvpLevel); } } if (!CSysDynamicBlock.bSocialBlocked) { if ((this.m_PlayerVipLevel != null) && (masterRoleInfo != null)) { this.m_PlayerVipLevel.text = string.Format("VIP{0}", masterRoleInfo.m_payLevel); } if (((form != null) && form.gameObject.activeSelf) && (masterRoleInfo != null)) { GameObject widget = form.GetWidget(2); if ((widget != null) && !string.IsNullOrEmpty(masterRoleInfo.HeadUrl)) { CUIHttpImageScript component = widget.GetComponent <CUIHttpImageScript>(); component.SetImageUrl(masterRoleInfo.HeadUrl); MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(component.GetComponent <Image>(), (int)masterRoleInfo.GetNobeInfo().stGameVipClient.dwCurLevel, false); Image image = form.GetWidget(3).GetComponent <Image>(); MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(image, (int)masterRoleInfo.GetNobeInfo().stGameVipClient.dwHeadIconId); bool flag = Singleton <HeadIconSys> .instance.UnReadFlagNum > 0; GameObject target = Utility.FindChild(widget, "RedDot"); if (target != null) { if (flag) { CUICommonSystem.AddRedDot(target, enRedDotPos.enTopRight, 0); } else { CUICommonSystem.DelRedDot(target); } } } } } else if ((form != null) && form.gameObject.activeSelf) { GameObject obj4 = form.GetWidget(2); if (obj4 != null) { CUIHttpImageScript script3 = obj4.GetComponent <CUIHttpImageScript>(); if (script3 != null) { MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(script3.GetComponent <Image>(), 0, false); } } } } }