using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CardManager : MonoBehaviour
{
    public int pairAmount;
    public Sprite[] spriteList;

    float offSet = 1.2f;

    public GameObject cardPrefab;

    void Start()
    {
        CreatePlayField();
    }

        void CreatePlayField()
    {
        for (int i = 0; i < pairAmount; i++)
        {
            for (int j = 0; j < 2; j++)
            {
            Vector3 pos = new Vector3(i * offSet, 0, 0);
            GameObject newCard = Instantiate(cardPrefab, pos, Quaternion.identity);
            newCard.GetComponent<Card>().SetCard(i, spriteList[i]);
            }


            
        }
    }

}