Пример #1
0
    public void SpawnCards()
    {
        // Set Grid Rows Number
        gridLayout.constraint      = GridLayoutGroup.Constraint.FixedRowCount;
        gridLayout.constraintCount = _gameData.configuration.rowSize;

        // Draw Cards
        for (int i = 0; i < _gameData.configuration.cardIds.Length; i++)
        {
            CardEntity    entity        = Instantiate(cardPrefab, gridLayout.transform).GetComponent <CardEntity>();
            CardBehaviour cardBehaviour = entity.GetComponent <CardBehaviour>();
            int           cardId        = _gameData.configuration.cardIds[i];
            entity.Id    = cardId;
            entity.Emote = cardsGraphics.emotes[cardId];
            cardBehaviour.Initialize(_dependencyContainer);
        }
    }