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 i = 0; i < m_mapWidth; i++) { Gizmos.DrawLine(new Vector3(0, 0, i), new Vector3(m_mapHeight, 0, i)); } //绘制长度的线 for (int i = 0; i < m_mapHeight; i++) { Gizmos.DrawLine(new Vector3(i, 0, 0), new Vector3(i, 0, m_mapWidth)); } } }
本文出自 “海灬未眠” 博客,请务必保留此出处http://745559847.blog.51cto.com/11658719/1892003
原文:http://745559847.blog.51cto.com/11658719/1892003