예제 #1
0
    private void OperatePlayCard(MahJongGameAction action)
    {
        if (action.Cards [0].IsUniversal)
        {
            //播放打宝声音
            MahjongAudioMgr.Instance.PlayDaBao(mUserInfo.Sex);
            //播放打宝特效
            mOperationEffectItem.SetEffectType(OperationEffectItem.OperationEffectType.DaBao);
        }
        else
        {
            MahjongAudioMgr.Instance.PlayChuPai();
        }

        //设置当前最新的行为
        mUIGameModel.LastGameActionResp = action.getCopy();
        //播放出牌的声音
        if (!action.Cards[0].IsUniversal)
        {
            MahjongAudioMgr.Instance.PlayChuPaiSound(mUserInfo.Sex, action.Cards[0], PlayerPrefs.GetInt(PrefsConstant.AudioType, 0));
        }
        //添加到桌牌
        mUserCardModel.addDeskCard(action.Cards[0]);
        //设置最新的桌牌
        mUIGameModel.LastDeskCard = action.Cards[0];
        //显示桌牌
        mDeskCardList[mUserCardModel.getDeskIndex()].RefreshDeskCard(mUserCardModel.getLastDeskCard(), mDirection);
        if (mUIGameModel.LastDeskCardItem != null)
        {
            mUIGameModel.LastDeskCardItem.SetCurrentDisableCard(false);
        }
        mUIGameModel.LastDeskCardItem = mDeskCardList[mUserCardModel.getDeskIndex()];
//        if (mDirection == DirectionType.bottom)
        {
            mUserCardModel.removeHandCard(mUserCardModel.getLastDeskCard());
        }
//        else
//        {
//            mUserCardModel.removeLastHandCard();
//        }
        //排序牌并刷新显示
        RefreshHandCards();
        mCurrCardItem.SetVisible(false);
    }
예제 #2
0
 private void Initialize()
 {
     mGunnerSprite.gameObject.SetVisible(false);
     mHuSprite.gameObject.SetVisible(false);
     mZhuangIcon.gameObject.SetVisible(false);
     mOwnerIcon.gameObject.SetVisible(false);
     mLabelTotalScore.text = "0";
     mLabelHupai.text      = "0";
     mLabelJingPai.text    = "0";
     mLabelName.text       = string.Empty;
     mLabelDes.text        = string.Empty;
     mHandCradGroupItems.ForEach(p => p.SetVisible(false));
     mHandCardItem.SetVisible(false);
     mCurrCardItem.SetVisible(false);
 }