private void SetActivityItemData(Transform tran, UserEncourageActVo vo) //,EncourageActDoneRuleVo donerule { var encouragevo = _supporterActivityModel.EncourageRuleDic[vo.ActId]; var notsupporttran = tran.Find("NotSupport"); var hassupporttran = tran.Find("HasSupport"); var hasActBg = hassupporttran.Find("HasActBG"); hasActBg.Find("SupportAct1").gameObject.SetActive(encouragevo.MovieId == 1); //取决于要不要显示 hasActBg.Find("SpineRoot").gameObject.SetActive(encouragevo.MovieId != 1); _actAni = encouragevo.MovieId == 1 ? hasActBg.Find("SupportAct1").gameObject : hasActBg.Find("SpineRoot/SpineSkeletonGraphic").gameObject; tran.gameObject.Show(); SetActItemStatePos(hassupporttran, notsupporttran, vo.StartState == 0, tran.GetSiblingIndex() == 1); if (vo.StartState == 0) { SetNotSupportData(notsupporttran, encouragevo, vo); SetDefaultState(hassupporttran, false); notsupporttran.SetAsLastSibling(); _actAni.transform.Find("02_scene")?.GetComponent <MovingTween>()?.PaseTween(); if (encouragevo.MovieId != 1) { SetSupporterSpine(_actAni, GetAni(encouragevo.MovieId)); } } else { //变成应援活动的时候才需要切换动画 if (vo.NeedToChangeAni) { _supporterActivityModel.GetUserActVo(vo.Id).NeedToChangeAni = false; ChangeActTween(notsupporttran, hassupporttran, tran.GetSiblingIndex() == 1, () => { //动画到某阶段的时候突然间改变 SetHasSupportData(hassupporttran, vo, encouragevo); SetDefaultState(notsupporttran, true); hassupporttran.SetAsLastSibling(); }); } else { SetHasSupportData(hassupporttran, vo, encouragevo); SetDefaultState(notsupporttran, true); hassupporttran.SetAsLastSibling(); } } }
private void OnStartActivityRes(StartRes res) { //先更新GlobaData的数据,然后回到应援活动界面! LoadingOverlay.Instance.Hide(); FlowText.ShowMessage(I18NManager.Get("SupporterActivity_StartSuccess") + SupporterActivityModel.EncourageRuleDic[res.UserEncourageActivity.ActId].Title); //GlobalData.PlayerModel.UpdateUserPower(res.UserPower); // Debug.LogError(res.UserEncourageActivity); GlobalData.PropModel.UpdateProps(res.UserItems); //就这里可能出现问题! foreach (var v in res.UserFans) { GlobalData.DepartmentData.UpdateFansWithNum(v.FansType, v.Num); } SupporterActivityModel.UpdateEncourageActs(res.UserEncourageActivity); SupporterActivityModel.GetUserActVo(res.UserEncourageActivity.Id).NeedToChangeAni = true; SendMessage(new Message(MessageConst.CMD_SUPPORTERACTIVITY_STARTSUCCESS, res.LeftInterCount)); EventDispatcher.TriggerEvent(EventConst.UpdateEnergy); SendMessage(new Message(MessageConst.MOUDLE_GUIDE_SUPPORTERACT_STARTSUCCESS)); }