예제 #1
0
        void OnDrawGizmos()
        {
            // draw world bounding box
            Gizmos.color = Color.blue;
            Gizmos.DrawCube(worldStart, Vector3.one);

            // botom
            Gizmos.DrawLine(worldStart, worldStart + new Vector3(worldWidth, 0, 0));
            Gizmos.DrawLine(worldStart + new Vector3(worldWidth, 0, 0), worldStart + new Vector3(worldWidth, 0, -worldLength));
            Gizmos.DrawLine(worldStart + new Vector3(worldWidth, 0, -worldLength), worldStart + new Vector3(0, 0, -worldLength));
            Gizmos.DrawLine(worldStart + new Vector3(0, 0, -worldLength), worldStart);

            //top
            Gizmos.DrawLine(worldStart + new Vector3(0, worldHeight, 0), worldStart + new Vector3(worldWidth, worldHeight, 0));
            Gizmos.DrawLine(worldStart + new Vector3(worldWidth, worldHeight, 0), worldStart + new Vector3(worldWidth, worldHeight, -worldLength));
            Gizmos.DrawLine(worldStart + new Vector3(worldWidth, worldHeight, -worldLength), worldStart + new Vector3(0, worldHeight, -worldLength));
            Gizmos.DrawLine(worldStart + new Vector3(0, worldHeight, -worldLength), worldStart + new Vector3(0, worldHeight, 0));


            //sides
            Gizmos.DrawLine(worldStart, worldStart + new Vector3(0, worldHeight, 0));
            Gizmos.DrawLine(worldStart + new Vector3(worldWidth, 0, 0), worldStart + new Vector3(worldWidth, worldHeight, 0));
            Gizmos.DrawLine(worldStart + new Vector3(worldWidth, 0, -worldLength), worldStart + new Vector3(worldWidth, worldHeight, -worldLength));
            Gizmos.DrawLine(worldStart + new Vector3(0, 0, -worldLength), worldStart + new Vector3(0, worldHeight, -worldLength));


            if (worldData.pathfinder != null)
            {
                worldData.DrawGizmos();
            }
        }
예제 #2
0
        private void OnDrawGizmos()
        {
            // draw world bounding box
            Gizmos.color = Color.blue;

            var matrix = Matrix4x4.TRS(new Vector3(0, 0, 0), Quaternion.Euler(-90, 0, 0), new Vector3(1, 1, 1));

            Gizmos.matrix = matrix;

            Gizmos.DrawCube(worldStart, Vector3.zero);

            //Bottom
            Gizmos.DrawLine(worldStart, worldStart + new Vector3(worldWidth, 0, 0));
            Gizmos.DrawLine(worldStart + new Vector3(worldWidth, 0, 0),
                            worldStart + new Vector3(worldWidth, 0, -worldLength));
            Gizmos.DrawLine(worldStart + new Vector3(worldWidth, 0, -worldLength),
                            worldStart + new Vector3(0, 0, -worldLength));
            Gizmos.DrawLine(worldStart + new Vector3(0, 0, -worldLength), worldStart);

            //Top
            Gizmos.DrawLine(worldStart + new Vector3(0, worldHeight, 0),
                            worldStart + new Vector3(worldWidth, worldHeight, 0));
            Gizmos.DrawLine(worldStart + new Vector3(worldWidth, worldHeight, 0),
                            worldStart + new Vector3(worldWidth, worldHeight, -worldLength));
            Gizmos.DrawLine(worldStart + new Vector3(worldWidth, worldHeight, -worldLength),
                            worldStart + new Vector3(0, worldHeight, -worldLength));
            Gizmos.DrawLine(worldStart + new Vector3(0, worldHeight, -worldLength),
                            worldStart + new Vector3(0, worldHeight, 0));

            //Sides
            Gizmos.DrawLine(worldStart, worldStart + new Vector3(0, worldHeight, 0));
            Gizmos.DrawLine(worldStart + new Vector3(worldWidth, 0, 0),
                            worldStart + new Vector3(worldWidth, worldHeight, 0));
            Gizmos.DrawLine(worldStart + new Vector3(worldWidth, 0, -worldLength),
                            worldStart + new Vector3(worldWidth, worldHeight, -worldLength));
            Gizmos.DrawLine(worldStart + new Vector3(0, 0, -worldLength),
                            worldStart + new Vector3(0, worldHeight, -worldLength));

            if (worldData.Pathfinder != null)
            {
                worldData.DrawGizmos();
            }
        }