using System.Collections;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using UnityEngine;
public class CreateGround : MonoBehaviour
{
[SerializeField]
public int Column = 1; // 列
public int Row = 1; // 行
public float spacing = 10f;
public GameObject ground;
private List<GameObject> groundLists = new();
void Start()
{
if (ground != null)
{
Debug.Log("Groung_Row:" + Row);
Debug.Log("Groung_Column:" + Column);
for (int row = 0; row < Row; row++)
{
for (int col = 0; col < Column; col++)
{
float x = col * spacing;
float z = row * spacing;
GameObject goj = GameObject.Instantiate(ground, new Vector3(x, 0, z), Quaternion.identity);
if (goj != null)
{
groundLists.Add(goj);
}
}
}
}
}
}