static public void Destroy(UIDrawCall dc) { if (dc) { if (Application.isPlaying) { if (mActiveList.Remove(dc)) { NGUITools.SetActive(dc.gameObject, false); mInactiveList.Add(dc); #if OPTIMISE_NGUI_GC_ALLOC CachedGeometries.PushToCachedGeometries(dc.verts, dc.uvs, dc.cols); dc.verts = new BetterList <Vector3>(); dc.uvs = new BetterList <Vector2>(); dc.cols = new BetterList <Color32>(); #endif } } else { mActiveList.Remove(dc); #if SHOW_HIDDEN_OBJECTS && UNITY_EDITOR if (UnityEditor.Selection.activeGameObject == dc.gameObject) { UnityEditor.Selection.activeGameObject = null; } #endif NGUITools.DestroyImmediate(dc.gameObject); } } }
void OnDestroy() { if (geometry.verts.buffer != null && geometry.verts.buffer.Length > 0) { CachedGeometries.PushToCachedGeometries(geometry); } RemoveFromPanel(); }
void OnDestroy() { if (geometry.verts.Capacity > 0) { CachedGeometries.PushToCachedGeometries(geometry); } RemoveFromPanel(); }