public void Update(Vector4 group) { GUI.BeginGroup(group, GUIStyle.Current.BorderColor); group.X = 0; group.Y = 0; m_root.Update(group); GUI.EndGroup(); }
public void Update(Vector4 size) { m_info.m_size = size; GUI.BeginGroup(size); //draw child if (IsContentNode()) { DrawDock(); } else { m_nodeL.ApplyNextSize(); m_nodeR.ApplyNextSize(); bool horizontal = m_info.m_orient == GUIDockOrient.Horizontal; float sl = horizontal ? m_nodeL.m_info.m_size.Z : m_nodeL.m_info.m_size.W; float sr = horizontal ? m_nodeR.m_info.m_size.Z : m_nodeR.m_info.m_size.W; float stepSize = 0; Vector4 crect = Vector4.Zero; if (horizontal) { crect.W = m_info.m_size.W; stepSize = m_info.m_size.Z / (sl + sr); } else { crect.Z = m_info.m_size.Z; stepSize = m_info.m_size.W / (sl + sr); } if (horizontal) { //nodeleft crect.Z = sl * stepSize; m_nodeL.Update(crect); crect.X += crect.Z; //seperator crect.X -= 1; crect.Z = 2; m_separator.Draw(crect); crect.X += 1; //noderight crect.Z = sr * stepSize; m_nodeR.Update(crect); crect.X += crect.Z; } else { //nodeleft crect.W = sl * stepSize; m_nodeL.Update(crect); crect.Y += crect.W; //seperator crect.Y -= 1; crect.W = 2; m_separator.Draw(crect); crect.Y += 1; //noderight crect.W = sr * stepSize; m_nodeR.Update(crect); crect.Y += crect.W; } } GUI.EndGroup(); }