Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update View.cs #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions Editor/Mono/View.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,29 @@ internal virtual void Reflow()
foreach (View c in children)
c.Reflow();
}

internal string DebugHierarchy(int level)
{
string prefix = "", s = "";
StringBuilder prefix = new StringBuilder();
StringBuilder s = new StringBuilder();
for (int i = 0; i < level; i++)
{
prefix = prefix + " ";
prefix.Append(" ");
}
s = s + prefix + this + " p:" + position;
s.Append($"{s}{prefix}{this} p:{position}");
if (children.Length > 0)
{
s += " {\n";
s.Append(" {\n");
foreach (View child in children)
{
s += child.DebugHierarchy(level + 2);
s.Append(child.DebugHierarchy(level + 2));
}
s += prefix + " }\n";
s.Append(prefix);
s.Append(" }\n");
}
else
s += "\n";
return s;
s.Append("\n");
return s.ToString();
}

// Can be used by concrete subclasses to store C++ objects
[SerializeField]
MonoReloadableIntPtr m_ViewPtr;
Expand Down