private void Init() { if (GameUtil.isVIP()) { VipTimeTxt.text = $"过期时间:{CommonUtil.splitStr_Start_str(PlayerInfoComponent.Instance.GetPlayerInfo().VipTime, ' ')}"; } else { VipTimeTxt.text = ""; } if (OtherData.getIsShiedBindPhone()) { bindPhoneBtn.transform.localScale = Vector3.zero; } if (OtherData.getIsShiedRealName()) { realNameBtn.transform.localScale = Vector3.zero; } bindPhoneBtn.gameObject.SetActive(string.IsNullOrEmpty(PlayerInfoComponent.Instance.GetPlayerInfo().Phone) && !OtherData.getIsShiedBindPhone()); bindPhoneBtn.transform.parent.gameObject.SetActive(string.IsNullOrEmpty(PlayerInfoComponent.Instance.GetPlayerInfo().Phone) && !OtherData.getIsShiedBindPhone()); changeNameBtn.gameObject.SetActive(PlayerInfoComponent.Instance.GetPlayerInfo().RestChangeNameCount > 0); changeNameBtn.transform.parent.gameObject.SetActive(PlayerInfoComponent.Instance.GetPlayerInfo().RestChangeNameCount > 0); realNameBtn.gameObject.SetActive(!PlayerInfoComponent.Instance.GetPlayerInfo().IsRealName&& !OtherData.getIsShiedRealName()); realNameBtn.transform.parent.gameObject.SetActive(!PlayerInfoComponent.Instance.GetPlayerInfo().IsRealName&& !OtherData.getIsShiedRealName()); realNameTxt.gameObject.SetActive(!OtherData.getIsShiedRealName()); noBindPhoneTxt.gameObject.SetActive(!OtherData.getIsShiedBindPhone()); GoldNumTxt.text = PlayerInfoComponent.Instance.GetPlayerInfo().GoldNum.ToString(); WingNumTxt.text = PlayerInfoComponent.Instance.GetPlayerInfo().WingNum.ToString(); HuafeiNumTxt.text = (PlayerInfoComponent.Instance.GetPlayerInfo().HuaFeiNum / 100.0f).ToString(); if (GameUtil.isVIP()) { PlayerFrame.transform.Find("HeadKuang").GetComponent <Image>().sprite = CommonUtil.getSpriteByBundle("image_main", "touxiangkuang_vip"); } }
public void Update() { HeadManager.setHeadSprite(playerIcon.GetComponent <Image>(), PlayerInfoComponent.Instance.GetPlayerInfo().Icon); nameTxt.text = PlayerInfoComponent.Instance.GetPlayerInfo().Name; if (PlayerInfoComponent.Instance.GetPlayerInfo().RestChangeNameCount <= 0) { changeNameBtn.gameObject.SetActive(false); changeNameBtn.transform.parent.gameObject.SetActive(false); } if (GameUtil.isVIP()) { VipTimeTxt.text = $"过期时间:{CommonUtil.splitStr_Start_str(PlayerInfoComponent.Instance.GetPlayerInfo().VipTime, ' ')}"; } else { VipTimeTxt.text = ""; } changeNameBtn.gameObject.SetActive(PlayerInfoComponent.Instance.GetPlayerInfo().RestChangeNameCount > 0); changeNameBtn.transform.parent.gameObject.SetActive(PlayerInfoComponent.Instance.GetPlayerInfo().RestChangeNameCount > 0); realNameBtn.gameObject.SetActive(!PlayerInfoComponent.Instance.GetPlayerInfo().IsRealName&& !OtherData.getIsShiedRealName()); realNameBtn.transform.parent.gameObject.SetActive(!PlayerInfoComponent.Instance.GetPlayerInfo().IsRealName&& !OtherData.getIsShiedRealName()); realNameTxt.gameObject.SetActive(!OtherData.getIsShiedRealName()); noBindPhoneTxt.gameObject.SetActive(!OtherData.getIsShiedBindPhone()); if (PlayerInfoComponent.Instance.GetPlayerInfo().IsRealName) { realNameTxt.text = "已实名"; realNameBtn.gameObject.SetActive(false); realNameBtn.transform.parent.gameObject.SetActive(false); } if (!string.IsNullOrEmpty(PlayerInfoComponent.Instance.GetPlayerInfo().Phone)) { noBindPhoneTxt.text = "已绑定"; bindPhoneBtn.gameObject.SetActive(false); bindPhoneBtn.transform.parent.gameObject.SetActive(false); } GoldNumTxt.text = PlayerInfoComponent.Instance.GetPlayerInfo().GoldNum.ToString(); }