public void SetData(HeadModel model) { _model = model; _curHeadPath = model.GetCurPlayerHeadPath(); var userData = GlobalData.PlayerModel.PlayerVo.UserOther; _headId = userData.Avatar; _headFrameId = userData.AvatarBox; CreateHeadItem(model.GetAllUserHeadData()); SetFontColor("All"); CreateHeadFrameItem(model.UserHeadFrameData); var curHeadVo = model.GetHeadInfo(_headId); var curHeadFrameVo = model.GetHeadFrameVo(_headFrameId); _headImg.texture = ResourceManager.Load <Texture>(curHeadVo.Path); _headFrameImg.texture = ResourceManager.Load <Texture>(curHeadFrameVo.Path); _headContent.GetText("Text").text = ""; _headFrameContent.GetText("Text").text = ""; SetHeadFrameRedDot(); }
private void UpdateHeadFrame() { _curHeadPath = _model.GetCurPlayerHeadPath(); for (int i = 0; i < _headFrameParent.childCount; i++) { var go = _headFrameParent.GetChild(i).gameObject; go.GetComponent <HeadFrameItem>().SetCurHead(_curHeadPath); } }