public virtual void RemoveAllChildrenWithCleanup(bool cleanup) { // not using detachChild improves speed here if (m_pChildren != null) { CCNode[] elements = m_pChildren.Elements; for (int i = 0, count = m_pChildren.count; i < count; i++) { CCNode node = elements[i]; // IMPORTANT: // -1st do onExit // -2nd cleanup if (m_bRunning) { node.OnExitTransitionDidStart(); node.OnExit(); } if (cleanup) { node.Cleanup(); } // set parent nil at the end node.Parent = null; } m_pChildren.Clear(); } }
private void DetachChild(CCNode child, bool doCleanup) { // IMPORTANT: // -1st do onExit // -2nd cleanup if (m_bRunning) { child.OnExitTransitionDidStart(); child.OnExit(); } // If you don't do cleanup, the child's actions will not get removed and the // its scheduledSelectors_ dict will not get released! if (doCleanup) { child.Cleanup(); } // set parent nil at the end child.Parent = null; m_pChildren.Remove(child); }
private void DetachChild(CCNode child, bool doCleanup) { // IMPORTANT: // -1st do onExit // -2nd cleanup if (m_bIsRunning) { child.OnExitTransitionDidStart(); child.OnExit(); } // If you don't do cleanup, the child's actions will not get removed and the // its scheduledSelectors_ dict will not get released! if (doCleanup) { child.Cleanup(); } // set parent nil at the end child.Parent = null; m_pChildren.Remove(child); }