protected void _RepaintTree() { m_root.CalcTreeWidth(); m_root.CalcTreeHeight(); var totalw = m_root.Width + 100f; content.sizeDelta = new Vector2(totalw, m_root.Height + 100f); m_root.SetPosition(new Vector2((m_root.WidthL - m_root.WidthR) * 0.5f, m_root.Height * 0.5f)); }
public float CalcTreeHeight() { if (isNil) { m_height = 50f; } else { var lw = lNode.CalcTreeHeight(); var rw = rNode.CalcTreeHeight(); m_height = Mathf.Max(lw, rw) + paddingy; } return(m_height); }