Ejemplo n.º 1
0
    private void ShowUserChoices(object[] dataObjects)
    {
        activeCard.HideCard();
        activeCards     = new GameObject[dataObjects.Length];
        optionsSelected = new bool[dataObjects.Length];
        float startingOffset = 0;

        switch (dataObjects.Length)
        {
        case 2:
            startingOffset = .5f * (CARD_WIDTH + CARD_SPACE);
            break;

        case 3:
            startingOffset = CARD_WIDTH + CARD_SPACE;
            break;
        }
        for (int i = 0; i < dataObjects.Length; i++)
        {
            optionsSelected[i] = false;
            float offset = -startingOffset + i * (CARD_WIDTH + CARD_SPACE);
            activeCards[i] = Instantiate(prefab);
            SelectableCard card = activeCards[i].GetComponent <SelectableCard>();
            card.transform.position = new Vector3(offset, CARD_HEIGHT);
            card.transform.SetParent(canvas.transform, false);
            card.ShowCard(dataObjects[i], true);
        }
    }
Ejemplo n.º 2
0
 private void ShowSelectedCard()
 {
     for (int i = 0; i < activeCards.Length; i++)
     {
         SelectableCard card = activeCards[i].GetComponent <SelectableCard>();
         if (card.IsSelected())
         {
             card.ShowCard((int)CardType.OPAL, false);
             break;
         }
     }
 }
Ejemplo n.º 3
0
    private void DiscoveryStage()
    {
        int card = logic.DrawCard();

        if (card == 0)
        {
            activeCard.ShowCard(logic.GetMonster(), false);
        }
        else
        {
            activeCard.ShowCard(card, false);
        }

        storyText.text = logic.GetCardText();
        stage++;
    }