public void Home() { print("Home"); if (root.GetHashCode() == currentWidget.GetHashCode()) { return; } currentWidget.Hide(); currentWidget = root; currentWidget.Show(); }
public void Back() { print("Back"); if (root.GetHashCode() == currentWidget.GetHashCode()) { return; } currentWidget.Hide(); currentWidget = currentWidget.parent; currentWidget.Show(); }
public void Navigate(int i) { print($"Navigate {i}"); if (currentWidget.childs.Count <= i) { print("theres no such a child"); return; } currentWidget.Hide(); currentWidget = currentWidget.childs[i]; currentWidget.Show(); }
private void Start() { var widgets = GetComponentsInChildren <TreeWidget>(); foreach (var w in widgets) { if (w.parent) { w.parent.AddChild(w); } w.Hide(); } currentWidget = root; currentWidget.Show(); }