/// <summary> /// 出牌显示 /// </summary> /// <param name="players"></param> private void ShowDiscard(PlayerInfo[] players) { if (isPlaying && room_info.discard_info.pre_discard_uid != room_info.discard_info.pre_uid) { //pass AudioManager.Instance.PlayEffect("Sound/PASS_CARD"); return; } for (int i = 0; i < 4; i++) { if (players[i].uid == room_info.discard_info.pre_discard_uid) { RecoverCards(); List <CombineResult> combines; if (room_info.game.IsMetallic()) { combines = TwillLogic.CheckCombines(room_info.discard_info.pre_discard_cards); } else { combines = new List <CombineResult>() { TwillLogic.CheckCombine(room_info.discard_info.pre_discard_cards) }; } foreach (var combine in combines) { if (combine != null) { if (combine.combine == Combine.Bomb) { //炸弹 AudioManager.Instance.PlayEffect("Sound/BOMB"); } else { //普通出牌 AudioManager.Instance.PlayEffect("Sound/OUT_CARD"); } } } switch (i) { case 0: ResetHandCard(players[i].show_cards, true); TableDiscard(room_info.discard_info.pre_discard_cards, mUIComponents.P1Table_Transform); break; case 1: TableDiscard(room_info.discard_info.pre_discard_cards, mUIComponents.P2Table_Transform); mUIComponents.P2CardNum_Text.text = room_info.players[i].hand_card_num.ToString(); break; case 2: TableDiscard(room_info.discard_info.pre_discard_cards, mUIComponents.P3Table_Transform); mUIComponents.P3CardNum_Text.text = room_info.players[i].hand_card_num.ToString(); break; case 3: TableDiscard(room_info.discard_info.pre_discard_cards, mUIComponents.P4Table_Transform); mUIComponents.P4CardNum_Text.text = room_info.players[i].hand_card_num.ToString(); break; } } } if (players[0].over_index > 0) { ResetHandCard(players[2].show_cards, false); } }
public GameObject CreateCard(byte card_value) { var number = TwillLogic.CardNumber(card_value); var huase = TwillLogic.CardHuase(card_value); var go = PoolManager.Instance.Pool <ItemsPool>().Spawn <Card>(); go.name = card_value.ToString(); var select_card = go.GetComponent <SelectCard>(); select_card.enabled = true; select_card.isSelected = false; var card = go.GetComponent <Card>(); if (number == CardEnum.ElderJoker || number == CardEnum.LittleJoker) { card.Number_Image.enabled = false; card.SmallHuase_Image.enabled = false; card.Huase_Image.enabled = true; card.Huase_Image.sprite = loadSprite(number.ToString()); } else { card.Number_Image.enabled = true; card.SmallHuase_Image.enabled = true; card.Huase_Image.enabled = false; if (huase == CardEnum.Diamond || huase == CardEnum.Hert) { card.Number_Image.sprite = loadSprite(number + "r"); } else { card.Number_Image.sprite = loadSprite(number + "b"); } //if (number <= CardEnum.Ten || number == CardEnum.Ace || number == CardEnum.Two) //{ // card.Huase_Image.sprite = loadSprite(huase.ToString()); //} //else //{ // if (huase == CardEnum.Diamond || huase == CardEnum.Hert) // { // card.Huase_Image.sprite = loadSprite(number + "r1"); // } // else // { // card.Huase_Image.sprite = loadSprite(number + "b1"); // } //} card.SmallHuase_Image.sprite = loadSprite(huase.ToString()); } card.Number_Image.SetNativeSize(); card.Huase_Image.SetNativeSize(); card.SmallHuase_Image.SetNativeSize(); return(go); }