/// <summary> /// 点击头像Item /// </summary> /// <param name="vo"></param> private void OnClickHead(HeadVo vo) { _headId = vo.Id; Text dest = _headContent.GetText("Text"); dest.text = vo.Desc; ShowPitchOnItemBottom(_headParent, vo.Id); _headImg.texture = ResourceManager.Load <Texture>(vo.Path); }
/// <summary> /// 获取头像具体信息 /// </summary> /// <param name="id">头像Id</param> /// <returns></returns> public HeadVo GetHeadInfo(int id) { HeadVo vo = null; foreach (var data in _userHeadData) { if (data.Id == id) { vo = data; break; } } return(vo); }
private void InitUserData() { _userHeadData = new List <HeadVo>(); _userHeadFrameData = new List <HeadFrameVo>(); //初始化用户头像数据 foreach (var rule in _headRule) { var vo = new HeadVo(rule); if (vo.IsUnlock) { _userHeadData.Add(vo); } } _userHeadData.Sort(); //初始化用户头像框数据 foreach (var rule in _headFrameRule) { var vo = new HeadFrameVo(rule); _userHeadFrameData.Add(vo); } _userHeadFrameData.Sort((x, y) => x.Sort.CompareTo(y.Sort)); }
public void SetData(HeadVo vo) { _data = vo; _head.texture = ResourceManager.Load <Texture>(vo.Path); }