Пример #1
0
        /// <summary>
        /// Draws the hash grid for debugging.
        /// </summary>
        public void DrawGrid(Camera cam, Color col)
        {
            float width  = Bounds.size.x;
            float height = Bounds.size.y;
            float depth  = Bounds.size.z;

            DrawLines.LineMode = LINE_MODE.LINES;

            for (float y = 0; y <= height; y++)
            {
                for (float x = 0; x <= width; x++)
                {
                    Vector3 a = Bounds.min + new Vector3(x, y, 0) * CellSize;
                    Vector3 b = Bounds.min + new Vector3(x, y, depth) * CellSize;

                    DrawLines.Draw(cam, a, b, col, Matrix4x4.identity);
                }

                for (float z = 0; z <= depth; z++)
                {
                    Vector3 a = Bounds.min + new Vector3(0, y, z) * CellSize;
                    Vector3 b = Bounds.min + new Vector3(width, y, z) * CellSize;

                    DrawLines.Draw(cam, a, b, col, Matrix4x4.identity);
                }
            }

            for (float z = 0; z <= depth; z++)
            {
                for (float x = 0; x <= width; x++)
                {
                    Vector3 a = Bounds.min + new Vector3(x, 0, z) * CellSize;
                    Vector3 b = Bounds.min + new Vector3(x, height, z) * CellSize;

                    DrawLines.Draw(cam, a, b, col, Matrix4x4.identity);
                }
            }
        }
Пример #2
0
 private void DrawBounds(Camera cam, Color col, Bounds bounds)
 {
     GetCorners(bounds);
     DrawLines.LineMode = LINE_MODE.LINES;
     DrawLines.Draw(cam, m_corners, col, Matrix4x4.identity, m_cube);
 }