Exemplo n.º 1
0
    public void SaveDeckChanges()
    {
        PlayerCardsInventory cardsInventory = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerCardsInventory>();
        int cardsInInventory = cardsInventory.CardsInventory.Count;
        int cardsInDeck      = playerDeckScript.cards.Count;

        for (int i = 0; i < cardsInInventory; i++)
        {
            cardsInventory.CardsInventory.RemoveAt(0);
        }

        for (int i = 0; i < 10; i++)
        {
            for (int j = 0; j < cardsInventoryPage[i].transform.childCount; j++)
            {
                cardsInventory.CardsInventory.Add(cardsInventoryPage[i].transform.GetChild(j).gameObject);
            }
        }

        for (int i = 0; i < cardsInDeck; i++)
        {
            playerDeckScript.cards.RemoveAt(0);
        }
        for (int i = 0; i < deckPos.transform.childCount; i++)
        {
            playerDeckScript.cards.Add(deckPos.transform.GetChild(i).gameObject);
        }
    }
Exemplo n.º 2
0
    private void Start()
    {
        player               = GameObject.FindGameObjectWithTag("Player");
        playerDeckScript     = player.GetComponent <PlayerDeck>();
        cardsInventoryScript = player.GetComponent <PlayerCardsInventory>();
        deckPos              = GameObject.FindGameObjectWithTag("Deck").transform;
        deckOrganizer        = GameObject.FindGameObjectWithTag("DeckOrganizer"); // o nome deckOrganizer se refere a aba de organização no total

        deckOrganizer.SetActive(false);

        player.transform.position = playerPos.position;
    }
Exemplo n.º 3
0
 void Start()
 {
     cardsInventoryScript = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerCardsInventory>();
 }