//---------------------- private static void f_width_width(GObject u1, GObject u2, RelationData data, bool percent) { float v = data.rightDist - data.leftDist; if (percent) { v = v / data.targetWidth * u2.width; } u1.width = u2.width + v; }
private static void f_height_height(GObject u1, GObject u2, RelationData data, bool percent) { float v = data.bottomDist - data.topDist; if (percent) { v = v / data.targetHeight * u2.height; } u1.height = u2.height + v; }
private static void f_bottomext_bottom(GObject u1, GObject u2, RelationData data, bool percent) { float h = u2.height; float v = data.bottomDist; if (percent) { v = v / data.targetHeight * h; } u1.height = u1.height + h + v - u1.height; Debug.Log("f_bottomext_bottom" + u1.height); }
private static void f_bottom_bottom(GObject u1, GObject u2, RelationData data, bool percent) { float y = u2 != u1.parent?u2.y:0; float h = u2.height; float v = data.bottomDist; if (percent) { v = v / data.targetHeight * h; } u1.y = y + h + v - u1.height; }
//---------------------- private static void f_middle_middle(GObject u1, GObject u2, RelationData data, bool percent) { float y = u2 != u1.parent?u2.y:0; float h = u2.height; float v = data.middleDist; if (percent) { v = v / data.targetHeight * h; } u1.y = y + h / 2 + v - u1.height / 2; }
//---------------------- private static void f_top_top(GObject u1, GObject u2, RelationData data, bool percent) { float y = u2 != u1.parent?u2.y:0; float h = u2.height; float v = data.topDist; if (percent) { v = v / data.targetHeight * h; } u1.y = y + v; }
private static void f_right_right(GObject u1, GObject u2, RelationData data, bool percent) { float x = u2 != u1.parent?u2.x:0; float w = u2.width; float v = data.rightDist; if (percent) { v = v / data.targetWidth * w; } u1.x = x + w + v - u1.width; }
//---------------------- private static void f_center_center(GObject u1, GObject u2, RelationData data, bool percent) { float x = u2 != u1.parent?u2.x:0; float w = u2.width; float v = data.centerDist; if (percent) { v = v / data.targetWidth * w; } u1.x = x + w / 2 + v - u1.width / 2; }
private static void f_rightext_right(GObject u1, GObject u2, RelationData data, bool percent) { float x = u2 != u1.parent ? u2.x : 0; float w = u2.width; float v = data.rightDist; if (percent) { v = v / data.targetWidth * w; } u1.width = w + v; Debug.Log("f_rightext_right" + u1.width); }
private static void f_leftext_right(GObject u1, GObject u2, RelationData data, bool percent) { float x = u2 != u1.parent?u2.x:0; float w = u2.width; float v = data.leftDist - data.targetWidth; if (percent) { v = v / data.targetWidth * w; } float tmp = u1.x; u1.x = x + w + v; u1.width = u1.width - (u1.x - tmp); Debug.Log("f_leftext_right x:" + u1.x + " w:" + u1.width); }
public RelationItem(GObject owner) { _owner = owner; _defs = new List <RelationDef>(); _data = new RelationData(); }
private static void f_bottomext_top(GObject u1, GObject u2, RelationData data, bool percent) { // }
private static void f_rightext_left(GObject u1, GObject u2, RelationData data, bool percent) { // }