using System; using Api; using Plugins.CxShine.Singleton; using UnityEngine.UI; namespace UI.Hall { public class UserInfoComp : UnitySingleton { public Text Diamond; public Text NickName; public Text UserId; public Image Avatar; private void Start() { RefreshSelfUI(); } public void RefreshSelfUI() { AccountManager.Instance.requestSelfInfo(data => { NickName.text = AccountManager.Instance.selfInfo.name + ""; UserId.text = "ID:" + AccountManager.Instance.selfInfo.playerId + ""; if (Diamond != null) { Diamond.text = "" + AccountManager.Instance.selfInfo.diamond + ""; } AvatarUtil.DisplayAvatar(Avatar, AccountManager.Instance.selfInfo.avatar); },((i, s) => { })); } } }