private void OperateTouchCard(MahJongGameAction action) { mUserCardModel.setTouchCard(action.Cards[0]); mUserCardModel.addHandCard(action.Cards[0]); mCurrCardItem.Refresh(mUserCardModel.getTouchCard(), mDirection); //播放摸牌音效 MahjongAudioMgr.Instance.PlayMoPai(); }
public void Refresh(SingleSettlementInfo msg) { Initialize(); this.mRoundMessage = msg; if (mRoundMessage != null) { SetVisible(true); UserInfo temp = null; if (GameMgr.Instance.isFromRecord) { temp = mUIGameModel.GetLiamUser(mRoundMessage.UserID); } else { temp = mUIGameModel.GetUser(mRoundMessage.UserID); } if (temp != null) { mZhuangIcon.gameObject.SetVisible(temp.IsZhuang); mOwnerIcon.gameObject.SetVisible(temp.IsOwner); AsyncImageDownload.Instance.SetAsyncImage(temp.HeadUrl, mHeadIcon); } mLabelName.text = mRoundMessage.Name; mLabelDes.text = mRoundMessage.IsHu ? mRoundMessage.HuFlag : string.Empty; mCurrCardItem.Refresh(mRoundMessage.CurCard, DirectionType.bottom); mHandCardItem.Refresh(mRoundMessage.HandCards, DirectionType.bottom); if (!mRoundMessage.HandCardGroups.IsNullOrEmpty()) { for (int i = 0; i < mRoundMessage.HandCardGroups.Count; i++) { mHandCradGroupItems[i].Refresh(mRoundMessage.HandCardGroups[i].Cards, DirectionType.bottom); } } mLabelTotalScore.text = mRoundMessage.Scores.TryGetValue(ScoreConst.TotalScore).ToString(); mLabelHupai.text = mRoundMessage.Scores.TryGetValue(ScoreConst.HuScore).ToString(); mLabelJingPai.text = mRoundMessage.Scores.TryGetValue(ScoreConst.BaoCardScore).ToString(); mHuSprite.gameObject.SetVisible(mRoundMessage.IsHu); mGunnerSprite.gameObject.SetVisible(mRoundMessage.Flag == 1); } else { SetVisible(false); } }