public void clear() { // is it a leaf? if (level == QuadTreeTouchEvent.DEEP_LEVEL_THRESHOLD) { leafContent.clear(); return; } // while not being a leaf then continue cleaning quad nodes if (topLeft != null) { topLeft.clear(); } if (topRight != null) { topRight.clear(); } if (botRight != null) { botRight.clear(); } if (botLeft != null) { botLeft.clear(); } }
void OnApplicationQuit() { dynamicListeners.clear(); staticQuadTree.clear(); #if UNITY_EDITOR #else // NOTE: to avoid !IsPlayingOrAllowExecuteInEditMode error in console instance = null; #endif }