Exemplo n.º 1
0
        private void SetActivePokemon(GameObject parent, PokemonCard pokemonCard)
        {
            if (pokemonCard == null || pokemonCard.IsDead())
            {
                return;
            }

            parent.DestroyAllChildren();

            var spawnedCard = Instantiate(cardPrefab, parent.transform);

            var controller = spawnedCard.GetComponentInChildren <CardRenderer>();

            controller.SetCard(pokemonCard, true);
            controller.SetIsActivePokemon();
            AddCard(controller);
        }