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 OnHeadTabChange(bool isOn) { if (isOn == false) { return; } string name = EventSystem.current.currentSelectedGameObject.name; PlayerPB pb = PlayerPB.None; if (name == "All") { SetFontColor("All"); CreateHeadItem(_model.GetAllUserHeadData()); return; } switch (name) { case "Other": SetFontColor("Other"); pb = PlayerPB.None; break; case "Tang": SetFontColor("Tang"); pb = PlayerPB.TangYiChen; break; case "Qin": SetFontColor("Qin"); pb = PlayerPB.QinYuZhe; break; case "Yan": SetFontColor("Yan"); pb = PlayerPB.YanJi; break; case "Chi": SetFontColor("Chi"); pb = PlayerPB.ChiYu; break; } CreateHeadItem(_model.GetUserHeadData(pb)); }