Exemplo n.º 1
0
    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);
            }
        }
    }
Exemplo n.º 2
0
 void OnDestroy()
 {
     if (geometry.verts.buffer != null && geometry.verts.buffer.Length > 0)
     {
         CachedGeometries.PushToCachedGeometries(geometry);
     }
     RemoveFromPanel();
 }
Exemplo n.º 3
0
 void OnDestroy()
 {
     if (geometry.verts.Capacity > 0)
     {
         CachedGeometries.PushToCachedGeometries(geometry);
     }
     RemoveFromPanel();
 }