FairyGUI.GObject.Dispose C# (CSharp) Method

Dispose() public method

public Dispose ( ) : void
return void
        public virtual void Dispose()
        {
            RemoveFromParent();
            RemoveEventListeners();
            relations.Dispose();
            if (displayObject != null)
            {
                displayObject.gOwner = null;
                displayObject.Dispose();
            }
        }

Usage Example

示例#1
0
        override public void Dispose()
        {
            int cnt = _transitions.Count;

            for (int i = 0; i < cnt; ++i)
            {
                Transition trans = _transitions[i];
                trans.Dispose();
            }

            cnt = _controllers.Count;
            for (int i = 0; i < cnt; ++i)
            {
                Controller c = _controllers[i];
                c.Dispose();
            }

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

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

            cnt = _children.Count;
            for (int i = cnt - 1; i >= 0; --i)
            {
                GObject obj = _children[i];
                obj.InternalSetParent(null);                 //Avoid GObject.RemoveParent call
                obj.Dispose();
            }
        }
All Usage Examples Of FairyGUI.GObject::Dispose