Esempio n. 1
0
        /**
         * @private
         */
        protected override void _onClear()
        {
            foreach (var bone in _bones)
            {
                bone.ReturnToPool();
            }

            foreach (var slot in _slots)
            {
                slot.ReturnToPool();
            }

            foreach (var evt in _events)
            {
                evt.ReturnToPool();
            }

            if (_clock != null)
            {
                _clock.Remove(this);
            }

            if (_proxy != null)
            {
                _proxy._onClear();
            }

            if (_replaceTextureAtlasData != null)
            {
                _replaceTextureAtlasData.ReturnToPool();
            }

            if (_animation != null)
            {
                _animation.ReturnToPool();
            }

            inheritAnimation = true;
            userData         = null;

            _delayDispose = false;
            _lockDispose  = false;
            _bonesDirty   = false;
            _slotsDirty   = false;
            _zOrderDirty  = false;
            _flipX        = false;
            _flipY        = false;
            _bones.Clear();
            _slots.Clear();
            _actions.Clear();
            _events.Clear();
            _armatureData            = null;
            _skinData                = null;
            _animation               = null;
            _proxy                   = null;
            _display                 = null;
            _eventManager            = null;
            _parent                  = null;
            _clock                   = null;
            _replaceTextureAtlasData = null;
            _replacedTexture         = null;
        }
        /**
         * @inheritDoc
         */
        protected override void _onClear()
        {
            foreach (var bone in _bones)
            {
                bone.ReturnToPool();
            }

            foreach (var slot in _slots)
            {
                slot.ReturnToPool();
            }

            foreach (var evt in _events)
            {
                evt.ReturnToPool();
            }

            if (_animation != null)
            {
                _animation.ReturnToPool();
            }

            if (_eventDispatcher != null && _eventDispatcher != _display) // May be _eventDispatcher and _display is the same one.
            {
                _eventDispatcher._onClear();
            }

            if (_display != null)
            {
                var armatureDisplay = _display as IArmatureDisplay;
                if (armatureDisplay != null)
                {
                    armatureDisplay._onClear();
                }
            }

            if (_clock != null)
            {
                _clock.Remove(this);
            }

            userData = null;

            _bonesDirty      = false;
            _flipX           = false;
            _flipY           = false;
            _cacheFrameIndex = -1;
            _armatureData    = null;
            _skinData        = null;
            _animation       = null;
            _eventDispatcher = null;
            _display         = null;
            _eventManager    = null;
            _parent          = null;
            _clock           = null;
            _replacedTexture = null;

            _delayDispose = false;
            _lockDispose  = false;
            _slotsDirty   = false;
            _bones.Clear();
            _slots.Clear();
            _actions.Clear();
            _events.Clear();
        }