private void updateCardDisplay() { if (activeCard == null) { displayDefaultCard(); } else { foreach (TextView t in cardValues) { t.SetTextColor(CardViewHelper.getCardColor(activeCard.Color)); t.Text = activeCard.Value; } foreach (ImageView t in cardColors) { t.SetImageResource(CardViewHelper.GetCardResource(activeCard.Color)); t.SetColorFilter(CardViewHelper.getCardColor(activeCard.Color)); } cardSymbol.SetTextColor(CardViewHelper.getCardColor(activeCard.Color)); cardSymbol.Text = activeCard.Color; if (activeCard.Value == "K") { cardSymbol.Text = cardSymbol.Text + "♔"; } else if (activeCard.Value == "Q") { cardSymbol.Text = cardSymbol.Text + "♕"; } else if (activeCard.Value == "J") { cardSymbol.Text = cardSymbol.Text + "♙"; } else { cardSymbol.Text = cardSymbol.Text + activeCard.Value; } } }
private void On(GameStartEvent e) { this._firendBtn.gameObject.SetActive(e.GameOver); this._exitRoomBtn.gameObject.SetActive(e.GameOver); this._destroyRoomBtn.gameObject.SetActive(e.GameOver); if (e.GameOver) { // 先重置UI Reset(); // 重新显示Player for (int i = 0; i < Game.Scene.GetComponent <Room>().Players.Length; i++) { EventBus.Publish(new PlayerRoomEvent { Seat = i, Action = PlayerRoomEvent.ActionState.Enter }); } return; } // 创建手牌 var handCards = LocalPlayerComponent.Instance.Player.GetComponent <HandCardsComponent>().Cards; CardViewHelper.CreateCards(this._card, this._handCardPanel.transform, handCards); this.handCardPanel.Reflush(); foreach (PlayerPanel playerPanel in this.playerPanels) { playerPanel.StartGame(); } // 显示局数 ReflushRoomInfo(); }
public void ShowPopCards(GameObject prefab, List <Card> cards) { CardViewHelper.CreateCards(prefab, this._playCard.transform, cards, false); }