コード例 #1
0
 public void OnCardSelections(List <CardBehaviour> selections)
 {
     if (selections.Count >= MAX_CARD_SELECTIONS)   // TODO: MW change this to be on click of a submit button
     {
         CardTray.SetCards(new List <CardState>());
         CardTray.Hide();
         Api.SubmitTurn(
             lobbyInfo.msg.id,
             currentTurn,
             lobbyInfo.playerName,
             lobbyInfo.playerId,
             selections.ConvertAll(c => c.Card.ID).ToArray(),
             () => { addToActivityStream("Submitted selections"); });
     }
 }
コード例 #2
0
        void Start()
        {
            cardTray = FindObjectOfType <CardTrayBehaviour>();

            List <CardState> cardStates = new List <CardState>();

            cardStates.Add(new CardState(0, (int)CardType.Unknown));
            cardStates.Add(new CardState(1, (int)CardType.TurnLeft));
            cardStates.Add(new CardState(2, (int)CardType.Rotate180));
            cardStates.Add(new CardState(3, (int)CardType.MoveForwardTwo));
            cardStates.Add(new CardState(4, (int)CardType.MoveForwardThree));
            cardStates.Add(new CardState(5, (int)CardType.MoveBackwardOne));
            cardTray.SetCards(cardStates);
        }