示例#1
0
        public static void DrawProperty(ref OBB2D shape)
        {
            shape.size = EditorGUILayoutExt.Vector2Field("Size", shape.size);
            var deg = EditorGUILayoutExt.FloatField("Deg", shape.deg);

            if (deg != shape.deg)
            {
                shape.SetDeg(deg);
            }
        }
示例#2
0
        public static void DrawOBB(OBB2D obb, Color color)
        {
            var right = obb.size.x * obb.right;
            var up    = obb.size.y * obb.up;
            var lb    = obb.pos - up - right;
            var lt    = obb.pos + up - right;
            var rt    = obb.pos + up + right;
            var rb    = obb.pos - up + right;

            Debug.DrawLine(lb.ToVector2(), lt.ToVector2(), color);
            Debug.DrawLine(lt.ToVector2(), rt.ToVector2(), color);
            Debug.DrawLine(rt.ToVector2(), rb.ToVector2(), color);
            Debug.DrawLine(rb.ToVector2(), lb.ToVector2(), color);
        }
示例#3
0
 void ShowShape(ref OBB2D obb, int idx)
 {
     ShowShape(ref obb, idx, DrawProperty);
 }