DockPanelLine AddVerticalLine(float r) { var m = new ModelElement(); m.Load(Left.model.ModData); float ex = Top.model.data.localPosition.y; float sx = Down.model.data.localPosition.y; float w = ex - sx; if (w < 0) { w = -w; } DockPanelLine line = new DockPanelLine(layout, m, Direction.Vertical); var pos = model.data.localPosition; float dx = Left.model.data.localPosition.x; pos.x = Right.model.data.localPosition.x - dx; pos.x *= r; pos.x += dx; line.SetSize(pos, new Vector2(DockPanel.LineWidth, w)); line.SetLineStart(Down); line.SetLineEnd(Top); return(line); }
DockPanelLine AddHorizontalLine(float r) { var m = new ModelElement(); m.Load(Top.model.ModData); float ex = Right.model.data.localPosition.x; float sx = Left.model.data.localPosition.x; float w = ex - sx; if (w < 0) { w = -w; } DockPanelLine line = new DockPanelLine(layout, m, Direction.Horizontal); var pos = model.data.localPosition; float dy = Down.model.data.localPosition.y; pos.y = Top.model.data.localPosition.y - dy; pos.y *= r; pos.y += dy; line.SetSize(pos, new Vector2(w, DockPanel.LineWidth)); line.SetLineStart(Left); line.SetLineEnd(Right); return(line); }
DockPanelLine AddVLine(float x) { var m = HGUIManager.GameBuffer.Clone(layout.LineMod).GetComponent <UIElement>(); float ex = Top.Enity.transform.localPosition.y; float sx = Down.Enity.transform.localPosition.y; float w = ex - sx; if (w < 0) { w = -w; } DockPanelLine line = new DockPanelLine(layout, m, Direction.Vertical); var pos = model.transform.localPosition; pos.x = x; line.SetSize(pos, new Vector2(DockPanel.LineWidth, w)); line.SetLineStart(Down); line.SetLineEnd(Top); return(line); }
DockPanelLine AddHLine(float y) { var m = HGUIManager.GameBuffer.Clone(layout.LineMod).GetComponent <UIElement>(); float ex = Right.Enity.transform.localPosition.x; float sx = Left.Enity.transform.localPosition.x; float w = ex - sx; if (w < 0) { w = -w; } DockPanelLine line = new DockPanelLine(layout, m, Direction.Horizontal); var pos = model.transform.localPosition; pos.y = y; line.SetSize(pos, new Vector2(w, DockPanel.LineWidth)); line.SetLineStart(Left); line.SetLineEnd(Right); return(line); }