コード例 #1
0
ファイル: MainActivity.cs プロジェクト: Bybeez/cardApp
        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;
                }
            }
        }
コード例 #2
0
ファイル: RoomPage.cs プロジェクト: OutsiderYY/ETBomb
        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();
        }
コード例 #3
0
ファイル: PlayerPanel.cs プロジェクト: OutsiderYY/ETBomb
 public void ShowPopCards(GameObject prefab, List <Card> cards)
 {
     CardViewHelper.CreateCards(prefab, this._playCard.transform, cards, false);
 }