using UnityEngine; using System.Collections; 时间:public class  GridMap MonoBehaviour { ,,,public int m_mapWidth =, 10;,,//宽度, ,,,public int m_mapHeight =, 10;,//长度 ,,,void OnDrawGizmos () ,,,{ ,,,,,,,Gizmos.color =, Color.blue; ,,,,,,,//绘制宽度的线 ,,,,,,,for (int 小姐:=,0;,小姐:& lt;, m_mapWidth;,我+ +) ,,,,,,,{ ,,,,,,,,,,,Gizmos.DrawLine (new Vector3 (0, 0, i),, new Vector3 (m_mapHeight,, 0,, i)); ,,,,,,,} ,,,,,,,//绘制长度的线 ,,,,,,,for (int 小姐:=,0;,小姐:& lt;, m_mapHeight;,我+ +) ,,,,,,,{ ,,,,,,,,,,,Gizmos.DrawLine (new Vector3(我,,0,0),,new Vector3(0,我还以为;m_mapWidth)); ,,,,,,,} ,,,} }