Ejemplo n.º 1
0
    private void OnDrawGizmos()
    {
        if (p1 == null || p2 == null)
        {
            return;
        }

        line.P1 = p1.transform.position.XZ();
        line.P2 = p2.transform.position.XZ();

        GizmosUtil.Push();

        Gizmos.color = color;
        Gizmos.DrawSphere(p1.position, 0.1f);
        Gizmos.DrawSphere(p2.position, 0.1f);


        var col = color;

        if (lineObj != null)
        {
            Vector2?intersectPoint = line.IntersectWith(lineObj.line);
            if (intersectPoint != null)
            {
                col          = Color.red;
                Gizmos.color = col;
                Gizmos.DrawSphere(intersectPoint.Value.ToXZ(), 0.1f);
            }
        }

        GizmosUtil.DrawLine(line, col);

        GizmosUtil.Pop();
    }
Ejemplo n.º 2
0
    private void OnDrawGizmos()
    {
        GizmosUtil.Push();

        rect.UpdateCenter(transform.position.XZ());


        var col = color;

        if (pointObj != null && rect.ContainPoint(pointObj.point))
        {
            col = Color.red;
        }
        else if (circleObj != null)
        {
            var ex_rect = rect.Expand(circleObj.circle.Radius, circleObj.circle.Radius);
            GizmosUtil.DrawRect(ex_rect, Color.green);
            if (circleObj.circle.IntersectWith(rect))
            {
                col = Color.red;
            }
        }
        else if (fandObj != null && rect.IntersectWith(fandObj.fan))
        {
            col = Color.red;
        }

        GizmosUtil.DrawRectSolid(rect, col);
        GizmosUtil.Pop();
    }
Ejemplo n.º 3
0
 private void OnDrawGizmos()
 {
     point = transform.position.XZ();
     GizmosUtil.Push();
     Gizmos.color = color;
     Gizmos.DrawSphere(point.ToXZ(), 0.05f);
     GizmosUtil.Pop();
 }
Ejemplo n.º 4
0
 private void OnDrawGizmos()
 {
     GizmosUtil.Push();
     fan.Center  = transform.position.XZ();
     fan.Forward = transform.forward.XZ().normalized;
     DrawPointGizmos();
     GizmosUtil.Pop();
 }
Ejemplo n.º 5
0
    private void OnDrawGizmos()
    {
        GizmosUtil.Push();

        circle.Center = transform.position.XZ();
        var col = color;

        if (rectObj != null && rectObj.rect.IntersectWith(circle))
        {
            col = Color.red;
        }
        else if (pointObj != null && circle.ContainPoint(pointObj.point))
        {
            col = Color.red;
        }
        else if (fanObj != null && circle.IntersectWith(fanObj.fan))
        {
            col = Color.red;
        }


        GizmosUtil.DrawCircleSolid(circle, col, mesh);
        GizmosUtil.Pop();
    }