Unity生成矩形点位
public class Tools { public static List<Vector3> CreatePoint(float height, float width, float spacing) { List<Vector3> _positionList = new List<Vector3>(); 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; } }