示例#1
0
 private void ShowNodes()
 {
     foreach (var node in graph.Nodes)
     {
         GizmosExtensions.DrawPoint(node.Position3D);
     }
 }
示例#2
0
 private void ShowLinks()
 {
     foreach (var node in graph.Nodes)
     {
         foreach (var neighbour in node.Neighbours)
         {
             GizmosExtensions.DrawLine(node.Position3D, neighbour.Position3D, Color.cyan);
         }
     }
 }
示例#3
0
文件: Sensor.cs 项目: deboxta/STINT
 private void OnDrawGizmosSelected()
 {
     if (SensedObjects != null)
     {
         foreach (var sensedObject in SensedObjects)
         {
             GizmosExtensions.DrawPoint(sensedObject.transform.position);
         }
     }
 }
示例#4
0
 private void OnDrawGizmosSelected()
 {
     if (debugStateTag != null)
     {
         GizmosExtensions.DrawText(Position, debugStateTag);
     }
     if (nodes != null)
     {
         GizmosExtensions.DrawPath(nodes);
     }
 }
示例#5
0
        private void ShowRegions()
        {
            var y = Mathf.Max(terrain.GrassBlockHeight, terrain.SandBlockHeight, terrain.WaterBlockHeight);

            foreach (var region in graph.Regions)
            {
                var topLeft2D     = region.TopLeft;
                var topRight2D    = region.TopRight;
                var bottomLeft2D  = region.BottomLeft;
                var bottomRight2D = region.BottomRight;

                var topLeft3D     = new Vector3(topLeft2D.x, y, topLeft2D.y);
                var topRight3D    = new Vector3(topRight2D.x, y, topRight2D.y);
                var bottomLeft3D  = new Vector3(bottomLeft2D.x, y, bottomLeft2D.y);
                var bottomRight3D = new Vector3(bottomRight2D.x, y, bottomRight2D.y);

                GizmosExtensions.DrawLine(topLeft3D, topRight3D, Color.cyan);
                GizmosExtensions.DrawLine(bottomLeft3D, bottomRight3D, Color.cyan);
                GizmosExtensions.DrawLine(topLeft3D, bottomLeft3D, Color.cyan);
                GizmosExtensions.DrawLine(topRight3D, bottomRight3D, Color.cyan);
            }
        }