FairyGUI.GComponent.Dispose C# (CSharp) Method

Dispose() public method

public Dispose ( ) : void
return void
        public override void Dispose()
        {
            int transCnt = _transitions.Count;
            for (int i = 0; i < transCnt; ++i)
            {
                Transition trans = _transitions[i];
                trans.Dispose();
            }

            if (scrollPane != null)
                scrollPane.Dispose();

            base.Dispose(); //Dispose native tree first, avoid DisplayObject.RemoveFromParent call

            int numChildren = _children.Count;
            for (int i = numChildren - 1; i >= 0; --i)
            {
                GObject obj = _children[i];
                obj.InternalSetParent(null); //Avoid GObject.RemoveParent call
                obj.Dispose();
            }
        }

Usage Example

Example #1
0
 override public void Dispose()
 {
     if (_content.texture != null)
     {
         if (_contentItem == null)
         {
             _content.texture.onSizeChanged -= _reloadDelegate;
             try
             {
                 FreeExternal(_content.texture);
             }
             catch (Exception err)
             {
                 Debug.LogWarning(err);
             }
         }
     }
     if (_errorSign != null)
     {
         _errorSign.Dispose();
     }
     if (_content2 != null)
     {
         _content2.Dispose();
     }
     _content.Dispose();
     base.Dispose();
 }
All Usage Examples Of FairyGUI.GComponent::Dispose