public void SetData() { for (int i = 0; i < 4; i++) { PlayerList[i].SetActive(false); } for (int i = 0; i < PartGameOverControl.instance.SettleInfoList.Count; i++) { PartGameOverControl.instance.SettleInfoList[i].LeftCardList = CardTools.CardValueSort(PartGameOverControl.instance.SettleInfoList[i].LeftCardList); PlayerList[i].SetActive(true); PlayerList[i].transform.GetComponent <UILabel>().text = GameDataFunc.GetPlayerInfo((byte)PartGameOverControl.instance.SettleInfoList[i].Pos).name.ToString(); PosAndCardList[PartGameOverControl.instance.SettleInfoList[i].Pos] = new List <GameObject>(); int count = PosAndCardList[PartGameOverControl.instance.SettleInfoList[i].Pos].Count; for (int j = 0; j < count; j++) { Destroy(PosAndCardList[PartGameOverControl.instance.SettleInfoList[i].Pos][j]); } PosAndCardList[PartGameOverControl.instance.SettleInfoList[i].Pos] = new List <GameObject>(); for (int j = 0; j < PartGameOverControl.instance.SettleInfoList[i].LeftCardList.Count; j++) { GameObject g = GameObject.Instantiate(CardObj, PlayerList[i].transform.Find("CardPoint")); g.transform.localScale = new Vector3(0.6f, 0.6f, 0.4f); g.transform.localPosition = new Vector3(j * 25, 0, 0); g.SetActive(true); g.transform.GetComponent <Card>().SetValue(PartGameOverControl.instance.SettleInfoList[i].LeftCardList[j]); PosAndCardList[PartGameOverControl.instance.SettleInfoList[i].Pos].Add(g); } } }
/// <summary> /// 判定出牌音效 /// </summary> /// <param name="cardlist"></param> public void CheckOperateSoundType(List <uint> cardlist, int sex) { cardlist = CardTools.CardValueSort(cardlist);//按值排序 switch (cardlist.Count) { case 0: int a = UnityEngine.Random.Range(1, 3); if (sex == 1) { SoundManager.Instance.PlaySound(UIPaths.GUOPAI_MAN + a.ToString()); } else { SoundManager.Instance.PlaySound(UIPaths.GUOPAI_WOMAN + a.ToString()); } break; case 1: int value = (int)cardlist[cardlist.Count - 1] % 100; if (sex == 1) { SoundManager.Instance.PlaySound(UIPaths.SINGLE_MAN + value.ToString()); } else { SoundManager.Instance.PlaySound(UIPaths.SINGLE_WOMAN + value.ToString()); } // SoundManager.Instance.PlaySound(UIPaths.SINGLE + value.ToString()); break; case 2: int value1 = (int)cardlist[cardlist.Count - 1] % 100; if (sex == 1) { SoundManager.Instance.PlaySound(UIPaths.DOUBLE_MAN + value1.ToString()); } else { SoundManager.Instance.PlaySound(UIPaths.DOUBLE_WOMAN + value1.ToString()); } //if (value1 > 2 && value1 < 16) //{ // SoundManager.Instance.PlaySound(UIPaths.DOUBLE + value1.ToString()); //} //else //{ // int value2 = (int)cardlist[1] % 100; // if (value2 > 2 && value2 < 16) // { // SoundManager.Instance.PlaySound(UIPaths.DOUBLE + value2.ToString()); // } // else // { // //对王 // } //} break; case 3: int value2 = (int)cardlist[cardlist.Count - 1] % 100; // SoundManager.Instance.PlaySound(UIPaths.THREECARD); if (sex == 1) { SoundManager.Instance.PlaySound(UIPaths.TRIPLE_MAN + value2.ToString()); } else { SoundManager.Instance.PlaySound(UIPaths.TRIPLE_WOMAN + value2.ToString()); } break; default: LandlordPokerType type = LandlordPokerType.None; try { // type = myQiPaiHelper.Instance.checkPokerType(cardlist); } catch (Exception e) { } switch (type) { case LandlordPokerType.Bomb: if (sex == 1) { SoundManager.Instance.PlaySound(UIPaths.BOOM_MAN); } else { SoundManager.Instance.PlaySound(UIPaths.BOOM_WOMAN); } SoundManager.Instance.PlaySound(UIPaths.BOOM); CardTypeAnim.Instance.PlayBoomAnim(); break; case LandlordPokerType.ContinueDoube: if (sex == 1) { SoundManager.Instance.PlaySound(UIPaths.LIANDUI_MAN); } else { SoundManager.Instance.PlaySound(UIPaths.LIANDUI_WOMAN); } // SoundManager.Instance.PlaySound(UIPaths.LIANDUI); CardTypeAnim.Instance.PlayLianDuiAnim(); break; case LandlordPokerType.ShuZi: if (sex == 1) { SoundManager.Instance.PlaySound(UIPaths.SHUNZHI_MAN); } else { SoundManager.Instance.PlaySound(UIPaths.SHUNZHI_WOMAN); } // SoundManager.Instance.PlaySound(UIPaths.SHUNZHI); CardTypeAnim.Instance.PlayShunZhiAnim(); break; case LandlordPokerType.WangBomb: if (sex == 1) { SoundManager.Instance.PlaySound(UIPaths.ROCK_MAN); } else { SoundManager.Instance.PlaySound(UIPaths.ROCK_WOMAN); } SoundManager.Instance.PlaySound(UIPaths.ROCK); CardTypeAnim.Instance.PlayRockAnim(); break; } break; } }