Beispiel #1
0
        /**
         * @private
         */
        protected override void _OnClear()
        {
            if (this._clock != null)
            {
                // Remove clock first.
                this._clock.Remove(this);
            }

            foreach (var bone in this._bones)
            {
                bone.ReturnToPool();
            }

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

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

            if (this._proxy != null)
            {
                this._proxy.DBClear();
            }

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

            this.inheritAnimation = true;
            this.armatureData     = null; //
            this.userData         = null;

            this._lockUpdate      = false;
            this._bonesDirty      = false;
            this._slotsDirty      = false;
            this._zOrderDirty     = false;
            this._flipX           = false;
            this._flipY           = false;
            this._cacheFrameIndex = -1;
            this._bones.Clear();
            this._slots.Clear();
            this._actions.Clear();
            this._animation = null; //
            this._proxy     = null; //
            this._display   = null;
            this._replaceTextureAtlasData = null;
            this._replacedTexture         = null;
            this._dragonBones             = null; //
            this._clock  = null;
            this._parent = null;
        }
Beispiel #2
0
        /// <internal/>
        /// <private/>
        internal void Init(ArmatureData armatureData, IArmatureProxy proxy, object display, DragonBones dragonBones)
        {
            if (this._armatureData != null)
            {
                return;
            }

            this._armatureData = armatureData;
            this._animation    = BaseObject.BorrowObject <Animation>();
            this._proxy        = proxy;
            this._display      = display;
            this._dragonBones  = dragonBones;

            this._proxy.DBInit(this);
            this._animation.Init(this);
            this._animation.animations = this._armatureData.animations;
        }
Beispiel #3
0
        /**
         * @private
         */
        internal void _init(
            ArmatureData armatureData, SkinData skinData,
            object display, IArmatureProxy proxy, IEventDispatcher <EventObject> eventManager
            )
        {
            if (_armatureData != null)
            {
                return;
            }

            _armatureData = armatureData;
            _skinData     = skinData;
            _animation    = BaseObject.BorrowObject <Animation>();
            _display      = display;
            _proxy        = proxy;
            _eventManager = eventManager;

            _animation._init(this);
            _animation.animations = _armatureData.animations;
        }
Beispiel #4
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;
        }