Exemplo n.º 1
0
 private void OnDrawGizmos()
 {
     Gizmos.color = Color.green;
     m_box.DrawGizmos(s_gizmos_color);
     m_circle.DrawGizmos(s_gizmos_color);
     m_cylinder.DrawGizmos(s_gizmos_color);
     m_line.DrawGizmos(s_gizmos_color);
     m_plane.DrawGizmos(s_gizmos_color);
     m_rectangle.DrawGizmos(s_gizmos_color);
     m_simpleBox.DrawGizmos(s_gizmos_color);
     m_simpleCircle.DrawGizmos(s_gizmos_color);
     m_sphere.DrawGizmos(s_gizmos_color);
     m_track.DrawGizmos(s_gizmos_color);
 }
Exemplo n.º 2
0
        public override void DrawGizmos(Color color)
        {
            var direction = m_axis.Direction;
            var up        = KaiTool_BasicGraphy.GetPerpendicularVector(direction);

            if (m_axis != null)
            {
                var origin   = m_axis.m_point0;
                var terminal = m_axis.m_point1;
                var circle0  = new KaiTool_SimpleCircle(origin.position, m_axis.Direction, m_radius);
                circle0.DrawGizmos(color);
                var circle1 = new KaiTool_SimpleCircle(terminal.position, m_axis.Direction, m_radius);
                circle1.DrawGizmos(color);
                var step = 8;
                for (int i = 0; i < step; i++)
                {
                    var startPoint = origin.position + Quaternion.AngleAxis((360f / step * i), direction) * up * m_radius;
                    var endPoint   = terminal.position + Quaternion.AngleAxis((360f / step * i), direction) * up
                                     * m_radius;
                    Gizmos.color = color;
                    Gizmos.DrawLine(startPoint, endPoint);
                }
            }
        }