void OnRightTipsClick(GameObject g) { //listGroup[1] //数据1 TGuanDanCT B = listGroup[1].ct; //数据0 SelfCardsManager.Instance.SendPutOutCardWithCT(B); ContextManager.Instance.Pop(curContext); }
//显示其他人出牌的信息 void SetOtherData(EPlayerPositionType type, List <uint> list, TGuanDanCT putOutType) { //为解决 玩家不出的bug int lastCardCount = Mathf.Clamp(playerRestCardNum[type] - list.Count, 0, GlobalData.mPlayerOwnCardCount); //(减完当前牌)剩余牌的张数 SetPlayerCardsPos(type, list, putOutType); SetRestCardNum(lastCardCount, type); }
void OnLeftTipsClick(GameObject g) { TGuanDanCT A = listGroup[0].ct; //数据0 SelfCardsManager.Instance.SendPutOutCardWithCT(A); //2.销毁当前的View ContextManager.Instance.Pop(curContext); }
public string GetCardAudioFileName(TGuanDanCT type, uint id, EAudioStyle style) { string file = ""; //这边待补充,posType的不同,播放不同语音效果 switch (type) { case TGuanDanCT.CT_SINGLE: file = GlobalData.mAudioSingleTitle + ValueByIdForAudio(id).ToString(); break; case TGuanDanCT.CT_DOUBLE: file = GlobalData.mAudioDoublleTitle + ValueByIdForAudio(id).ToString(); break; case TGuanDanCT.CT_FOUR_KING: case TGuanDanCT.CT_SI_ZHANG_BOMB: case TGuanDanCT.CT_WU_ZHANG_BOMB: case TGuanDanCT.CT_LIU_ZHANG_BOMB: case TGuanDanCT.CT_QI_ZHANG_BOMB: case TGuanDanCT.CT_BA_ZHANG_BOMB: case TGuanDanCT.CT_JIU_ZHANG_BOMB: case TGuanDanCT.CT_SHI_ZHANG_BOMB: file = "audio_zhadan"; break; case TGuanDanCT.CT_GANG_BAN: file = "audio_feiji"; break; case TGuanDanCT.CT_LIANG_LIAN_DUI: file = "audio_sanliandui"; break; case TGuanDanCT.CT_SHUN_ZI: file = "audio_shunzi"; break; case TGuanDanCT.CT_THREE_TIAO: file = "audio_sanzhang"; break; case TGuanDanCT.CT_TONG_HUA_SHUN: file = "audio_tonghuashun"; break; case TGuanDanCT.CT_HU_LU: file = "audio_sandaier"; break; case TGuanDanCT.CT_BUCHU: file = GlobalData.mAudioBuyao; break; } return(GlobalData.GetAudioBasePathByStyle(style) + file); }
void SaveSortRecord(List <uint> list, TGuanDanCT type) { int id = SelfCardsManager.Instance.mSortRecordList.Count; List <uint> tempList = new List <uint>(); for (int i = 0; i < list.Count; i++) { tempList.Add(list[i]); } SelfCardsManager.Instance.mSortRecordList.Add(tempList); SelfCardsManager.Instance.mSortRecordTypeList.Add(type == TGuanDanCT.CT_TONG_HUA_SHUN ? 0 : 100); //同花顺则放到第一个位置,否则放到最后一个位置(100代替) }
public void SendPutOutCardWithCT(TGuanDanCT type) { MsgGlobal mGl = new MsgGlobal(); ZhiWa.MsgAction msg = new ZhiWa.MsgAction(); mGl.guandan_room.action = msg; msg.action_id = (ulong)PlayerInfo.Instance.mPlayerPid; for (int i = 0; i < mCurSelectCardIds.Count; i++) { var id = mCurSelectCardIds[i]; msg.action_card.Add(id); } msg.action_ct = type; //待补充缝人配,2代替后的牌发到服务器。 TCPNetWork.GetInstance().SendMsgToServer(ServerMsgKey.CLIENT_SHOW_CARD, mGl); }
void SetPlayerCardsPos(EPlayerPositionType type, List <uint> list, TGuanDanCT putOutType) { //他人出牌只用于显示 Transform parentContainer = GetCardsParentPosContainer(type); EAudioStyle audioStyle = RoomInfo.Instance.GetPlayerAudioStyleByPlayerPos(type); //PlayTween TweenManager.Instance.PlayCardTween(putOutType, parentContainer); if (putOutType != TGuanDanCT.CT_BUCHU) { AudioManager.Instance.PlayEffectAudio(SelfCardsManager.Instance.GetCardAudioFileName(putOutType, list[0], audioStyle)); //Debug.LogError("玩家位置:"+type.ToString()+"玩家的音效类型:"+audioStyle); int count = list.Count; for (int i = 0; i < count; i++) { GameObject item = Instantiate(singleCardPrefab); item.transform.SetParent(parentContainer); item.transform.localPosition = GetOtherCardsPos(type, i, count); item.transform.localScale = Vector3.one; SingleCard singleCard = item.transform.GetComponent <SingleCard>(); singleCard.SetOtherData(list[i], type, false); } } else if (putOutType == TGuanDanCT.CT_BUCHU) { AudioManager.Instance.PlayEffectAudio(SelfCardsManager.Instance.GetCardAudioFileName(putOutType, 0, audioStyle)); //Debug.LogError("玩家位置:" + type.ToString() + "玩家的音效类型:" + audioStyle); // mRefuseCardNumId 为 不要的牌 id ,这里把自己的不出也当做别人的不出 GameObject item = GameObject.Instantiate(singleCardPrefab) as GameObject; item.transform.SetParent(parentContainer); item.transform.localPosition = GetOtherCardsPos(type, 0, 1); item.transform.localScale = Vector3.one; SingleCard singleCard = item.transform.GetComponent <SingleCard>(); singleCard.SetOtherData(GlobalData.mRefuseCardNumId, type, false); } }
string GetSprName(TGuanDanCT type) { string sprName = ""; switch (type) { case TGuanDanCT.CT_BA_ZHANG_BOMB: case TGuanDanCT.CT_SI_ZHANG_BOMB: case TGuanDanCT.CT_WU_ZHANG_BOMB: case TGuanDanCT.CT_LIU_ZHANG_BOMB: case TGuanDanCT.CT_QI_ZHANG_BOMB: sprName = "pk_zha"; break; case TGuanDanCT.CT_SHUN_ZI: //顺子 sprName = "pk_shunzi"; break; case TGuanDanCT.CT_LIANG_LIAN_DUI: //连对 sprName = "pk_liandui_0"; break; case TGuanDanCT.CT_TONG_HUA_SHUN: //同花顺 sprName = "pk_tonghuashun"; break; case TGuanDanCT.CT_GANG_BAN: //飞机 sprName = "pk_feiji"; break; case TGuanDanCT.CT_HU_LU: //借风 sprName = "pk_jiefeng"; break; } return(sprName); }
public GameObject PlayCardTween(TGuanDanCT type, Transform parent) { if (type == TGuanDanCT.CT_BUCHU || type == TGuanDanCT.CT_ERROR) { return(null); } GameObject guandanAnimType = null; switch (type) { case TGuanDanCT.CT_SI_ZHANG_BOMB: case TGuanDanCT.CT_WU_ZHANG_BOMB: case TGuanDanCT.CT_LIU_ZHANG_BOMB: case TGuanDanCT.CT_QI_ZHANG_BOMB: case TGuanDanCT.CT_BA_ZHANG_BOMB: case TGuanDanCT.CT_JIU_ZHANG_BOMB: case TGuanDanCT.CT_SHI_ZHANG_BOMB: string path = GlobalData.mLocalViewAnimationPath + "AnimCardType"; guandanAnimType = GetBoomAnimGm(parent, path); //SharkScreen(parent.parent.parent.parent.gameObject, 40); AudioManager.Instance.PlayCardTweenAudio("m_boom"); PlayPlayingAnim(guandanAnimType, "zhadan"); //播放炸弹动画 break; case TGuanDanCT.CT_FOUR_KING: string pathKing = GlobalData.mLocalViewAnimationPath + "AnimFourKingBoom"; guandanAnimType = GetBoomAnimGm(parent, pathKing); SharkScreen(parent.parent.parent.parent.gameObject, 120); AudioManager.Instance.PlayCardTweenAudio("m_boom"); PlayPlayingAnim(guandanAnimType); break; case TGuanDanCT.CT_TONG_HUA_SHUN: //同花顺 string pathTonghua = GlobalData.mLocalViewAnimationPath + "AnimCardType"; guandanAnimType = GetBoomAnimGm(parent, pathTonghua); //SharkScreen(parent.parent.parent.parent.gameObject, 80); AudioManager.Instance.PlayCardTweenAudio("m_boom"); PlayPlayingAnim(guandanAnimType, "tonghuashun"); break; case TGuanDanCT.CT_LIANG_LIAN_DUI: //连对 string pathLiandui = GlobalData.mLocalViewAnimationPath + "AnimCardType"; guandanAnimType = GetBoomAnimGm(parent, pathLiandui); PlayPlayingAnim(guandanAnimType, "liandui"); break; case TGuanDanCT.CT_SHUN_ZI: string pathShunzi = GlobalData.mLocalViewAnimationPath + "AnimCardType"; guandanAnimType = GetBoomAnimGm(parent, pathShunzi); PlayPlayingAnim(guandanAnimType, "shunzi"); break; case TGuanDanCT.CT_GANG_BAN: //飞机 FeijiAnim(parent); break; } listCardTypeAnims.Add(guandanAnimType); return(guandanAnimType); }