Exemplo n.º 1
0
 ///-----------------------------------------------------------------
 public DebugPrimitiveSetup(DebugPrimitiveType type, DebugStyle setup)
 {
     this.type     = type;
     this.setup    = setup;
     endDebugSpace = DebugSpace.World;
     pos           = Vector3.zero;
     rot           = Quaternion.identity;
     extents       = Vector3.one;
     range         = Statics.vec2(0, 1);
 }
Exemplo n.º 2
0
            public static Rect Square(ref Rect rect, int margin = 0, GUIStyle style = null)
            {
                var box = rect;

                box.width = Statics.min(box.width, box.height);
                box.width = box.height;

                if (rect.width == box.width)
                {
                    rect = rect.TruncateY(rect.width);
                }
                else if (rect.height == box.height)
                {
                    rect = rect.TruncateX(rect.height);
                }

                if (style != null)
                {
                    GUI.Box(box, GUIContent.none, style);
                }

                return(box.Inflate(-margin));
            }