//录像出牌 public virtual void Video_ChuCard(int card) { HideWinCard(); _VideoHands.Remove(card); float animCardSize = 1f; if (ClientSeatIndex == 0) { animCardSize = 0.5f; } if (card == _VideoMoCardSize) { CoroutineMgr.StartCoroutinee(ChuCardAnimSound(card, _WinCard.gameObject.transform.position, animCardSize)); } else { for (int i = 0; i < _liangCards.Count; i++) { if (_liangCards[i].CardSize == card) { CoroutineMgr.StartCoroutinee(ChuCardAnimSound(card, _liangCards[i].gameObject.transform.position, animCardSize)); break; } } } Video_RefreshHand(); }
//显示碰杠信息 private void ShowPengGangHnads() { ClearCards();//显示之前先清空一下牌 //显示玩家的牌 for (int i = 0; i < mData.PengGangInfos.Count; i++) { //碰杠的牌 if (mData.PengGangInfos[i].OperateType == FiveStarOperateType.Peng) { ShowPengGang(mData.PengGangInfos[i].Card, 3); } else if (mData.PengGangInfos[i].OperateType == FiveStarOperateType.MingGang || mData.PengGangInfos[i].OperateType == FiveStarOperateType.AnGang || mData.PengGangInfos[i].OperateType == FiveStarOperateType.CaGang) { ShowPengGang(mData.PengGangInfos[i].Card, 4); } } //显示手牌 ShowHand(mData.Hands); //如果是胡牌玩家还要显示赢的牌 if (mData.PlayerResultType == FiveStarPlayerResultType.HuFangChong || mData.PlayerResultType == FiveStarPlayerResultType.ZiMoHu) { ShowHand(new RepeatedField <int>() { mData.WinCard }); } //因为 UI布局不是实时生效 所以先隐藏 在显示就OK了 CoroutineMgr.StartCoroutinee(AwaitShowHandGroups()); }
//发牌操作 private void Deal(Video_Deal deal) { for (int i = 0; i < deal.AllHands.Count; i++) { _Coroutines[i + 1] = CoroutineMgr.StartCoroutinee(_PlayerDic[i].Video_Deal(deal.AllHands[i])); ReduceCardTotalNum(deal.AllHands[i].Count); } }
public override void StartGame(params object[] objs) { //参数1.List<object> 小局操作信息 base.StartGame(); Log.Debug("进入游戏卡五星录像"); FiveStarVideoRoom cardFiveStarRoom = Game.Scene.AddComponent <FiveStarVideoRoom>(); UIComponent.GetUiView <CardFiveStarRoomPanelComponent>().Show(); UIComponent.GetUiView <CardFiveStarRoomPanelComponent>().CutWatchVideoInUI(); UIComponent.GetUiView <CardFiveStarVideoPanelComponent>().Show(); cardFiveStarRoom._Coroutines[0] = CoroutineMgr.StartCoroutinee(cardFiveStarRoom.StarPlay(objs[0] as List <object>)); }
public void Show(GameObject cardGo, int yaxleOfset) { if (_AnimCoroutine != null) { CoroutineMgr.StopCoroutinee(_AnimCoroutine); } JianTouGo.gameObject.SetActive(true); JianTouGo.transform.SetParent(UIComponent.GetUiView <CardFiveStarRoomPanelComponent>().gameObject.transform); JianTouGo.transform.localScale = Vector3.one; JianTouGo.transform.SetParent(cardGo.transform); _offsetVector3.y = yaxleOfset; JianTouGo.transform.localPosition = Vector3.zero + _offsetVector3; _AnimCoroutine = CoroutineMgr.StartCoroutinee(JinaTouAnim()); }
//出牌 public override void ChuCard(int card) { Vector3 playCardPoint; if (CardFiveStarHandComponent.Ins._DragPlayPoint != Vector3.zero)//如果拖动出牌的 位置 不是0 就用拖动出牌的位置 { playCardPoint = CardFiveStarHandComponent.Ins._DragPlayPoint; CardFiveStarHandComponent.Ins._DragPlayPoint = Vector3.zero; } else if (CardFiveStarHandComponent.Ins.UpChuCardHand != null) { playCardPoint = CardFiveStarHandComponent.Ins.UpChuCardHand.gameObject.transform.position; } else { playCardPoint = CardFiveStarHandComponent.Ins._NewHand.gameObject.transform.position; } CardFiveStarHandComponent.Ins.ChuCard(card);//UpChuCardHand 可能为空 这个方法会判断并赋值 CoroutineMgr.StartCoroutinee(ChuCardAnimSound(card, playCardPoint, 0.5f)); }
//重新开始 public void AnewStart() { ClearUIAndCoroutine(); _Coroutines[0] = CoroutineMgr.StartCoroutinee(StarPlay(_VideoData)); }
public IEnumerator StarPlay(List <object> datas) { UIComponent.GetUiView <CardFiveStarVideoPanelComponent>().SetTotalScheduleText(datas.Count - 1); //初始化不算步骤 所有减一 _ResideNum = 84; //初始化牌数量 _VideoData = datas; for (int i = 0; i < datas.Count; i++) { UIComponent.GetUiView <CardFiveStarVideoPanelComponent>().SetCurrScheduleText(i); object data = datas[i]; if (data.GetType() == typeof(Video_GameInit)) { Video_GameInit meesage = data as Video_GameInit; GameInit(meesage); } else if (data.GetType() == typeof(Video_Deal)) { Video_Deal meesage = data as Video_Deal; Deal(meesage); yield return(new WaitForSeconds(2f)); } else if (data.GetType() == typeof(Video_PiaoFen)) { Video_PiaoFen meesage = data as Video_PiaoFen; _Coroutines[_Coroutines.Length - 1] = CoroutineMgr.StartCoroutinee(PiaoFen(meesage)); yield return(new WaitForSeconds(2f)); } else if (data.GetType() == typeof(Actor_FiveStar_PlayCardResult)) { Actor_FiveStar_PlayCardResult meesage = data as Actor_FiveStar_PlayCardResult; _PlayerDic[meesage.SeatIndex].Video_ChuCard(meesage.Card); CurrEndChuCardSeatIndex = meesage.SeatIndex; yield return(new WaitForSeconds(1f)); } else if (data.GetType() == typeof(Actor_FiveStar_MoPai)) { Actor_FiveStar_MoPai meesage = data as Actor_FiveStar_MoPai; _PlayerDic[meesage.SeatIndex].Video_MoCard(meesage.Card); ReduceCardTotalNum(1);//显示减少一张牌的数量 yield return(new WaitForSeconds(0.5f)); } else if (data.GetType() == typeof(Actor_FiveStar_OperateResult)) { Actor_FiveStar_OperateResult meesage = data as Actor_FiveStar_OperateResult; _PlayerDic[meesage.SeatIndex].Video_PengGangHu(meesage.OperateInfo.OperateType, meesage.OperateInfo.Card, meesage.OperateInfo.PlayCardIndex); yield return(new WaitForSeconds(1f)); } else if (data.GetType() == typeof(Actor_FiveStar_LiangDao)) { Actor_FiveStar_LiangDao meesage = data as Actor_FiveStar_LiangDao; _PlayerDic[meesage.SeatIndex].Video_LiangDao(); yield return(new WaitForSeconds(1f)); } else if (data.GetType() == typeof(Actor_FiveStar_MaiMa)) { Actor_FiveStar_MaiMa meesage = data as Actor_FiveStar_MaiMa; MaiMa(meesage); yield return(new WaitForSeconds(2f)); } else if (data.GetType() == typeof(Actor_FiveStar_SmallResult)) { Actor_FiveStar_SmallResult meesage = data as Actor_FiveStar_SmallResult; ShowSmallResult(meesage); } } }
//出牌 public virtual void ChuCard(int card) { CardFiveStarRoom.Ins.ReduceCardInNum(card); //减少牌对应的数量 CoroutineMgr.StartCoroutinee(ChuCardAnimSound(card, _NewHandPointGo.transform.position)); //出牌动画 和音效 HideMoCard(); }