public static async ETTask <bool> AddDependView(UserInfoView view, bool request = false) { if (_dependViews.Contains(view)) { return(false); } _dependViews.Add(view); await GetUserInfo(request); INTERNAL_SET_USERINFOVIEW(view, UserInfo); return(true); }
private static void INTERNAL_SET_USERINFOVIEW(UserInfoView view, UserInfo info) { //修复金币负数情况下 if (info.Gold < 0) { info.Gold = 0; } view.GoldText.text = info.Gold.ToString("F2"); UserHeadHelper.SetHeadImage(view.HeadImg, info.HeadId); view.NickNameText.text = info.Nickname; view.UserIdText.text = $"{info.PlayerId:000000}"; view.SexGo?.transform.GetChild(0).gameObject.SetActive(info.Gender == 1); view.SexGo?.transform.GetChild(1).gameObject.SetActive(info.Gender == 2); //更新大厅二级界面金币显示 var uic = Game.Scene.GetComponent <UIComponent>(); if (uic.Get(UIType.UIHallPanel) != null) { var lobbyCpt = uic.Get(UIType.UIHallPanel).GetComponent <GameLobbyCpt>(); if (lobbyCpt != null) { lobbyCpt.GameLobbyGameTypeSelectPlugin.GameTypeGoldNumberText.text = UserDataHelper.UserInfo.Gold.ToString("F2"); } } if (uic.Get(UIType.UIHallPanel) != null) { var lobbyCpt = uic.Get(UIType.UIHallPanel).GetComponent <GameLobbyCpt>(); if (lobbyCpt != null) { } } //增加对个人中心数据刷新 if (uic.Get(UIType.UserCenterWin) != null) { var userCenterCpt = uic.Get(UIType.UserCenterWin).GetComponent <GameUserCenterCpt>(); if (userCenterCpt != null) { userCenterCpt.RefBindPhoneNum(); } } }