private void BuildPathMap() { targetList.Clear(); Vector3 min, center, max; m_dbgRenderMesh.GetBounds(out min, out center, out max); for (float i = min.x; i < max.x;) { for (float j = min.z; j < max.z;) { Vector3 _point = new Vector3(i, 10000, j); RaycastHit hit; if (Physics.Raycast(new Ray(_point, new Vector3(0, -1, 0)), out hit, 20000.0f)) { targetList.Add(hit.point); } j += m_pathSpace; } i += m_pathSpace; } }