Unity生成矩形点位


public class Tools
{
    public static List CreatePoint(float height, float width, float spacing)
    {
        List _positionList = new List();
        for (float z = ((float)height - 1) / 2; z >= -((float)height - 1) / 2; z--)
        {
            for (float x = -((float)width - 1) / 2; x <= ((float)width - 1) / 2; x++)
            {
                _positionList.Add(new Vector3(x * spacing, 0, z * spacing));
            }
        }
        return _positionList;
    }
}