Ejemplo n.º 1
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();
    }