public void EnumerateChilds(OnEnumerateRectHandler method, bool forward) { var status = new EnumerateChildStatus() { skipChild = false, skipAll = false }; EnumerateChilds(method, forward, status); }
public void EnumerateChilds(OnEnumerateRectHandler method, bool forward, EnumerateChildStatus status) { if (forward) { for (int i = 0; i < Count; i++) { method(m_childs[i].Child, status); if (status.skipAll) { return; } if (!status.skipChild) { m_childs[i].Child.EnumerateChilds(method, forward, status); } if (status.skipAll) { return; } } } else { for (int i = Count - 1; i >= 0; i--) { method(m_childs[i].Child, status); if (status.skipAll) { return; } if (!status.skipChild) { m_childs[i].Child.EnumerateChilds(method, forward, status); } if (status.skipAll) { return; } } } }
public void EnumerateChilds(OnEnumerateRectHandler method) { EnumerateChilds(method, true); }