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

public class SpawnGrid : MonoBehaviour
{
    public GameObject prefab;
    public int rowCount = 5;
    public int colCount = 5;
    public float spacing = 1f;

    void Start()
    {
        var basePos = transform.position;
        for(int row = 0; row < rowCount; row++)
        {
            for(int col = 0; col < colCount; col++)
            {
                var pos = new Vector3(spacing * row, 0 , spacing * col);
                var shiftPos = pos + basePos;
                Instantiate(prefab, shiftPos, Quaternion.identity);
            }
        }
    }
}
