/**
         * @private
         */
        public void _onAdd(WorldClock value)
        {
            if (_clock != null)
            {
                _clock.Remove(this);
            }

            _clock = value;
        }
Beispiel #2
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;
        }
    static int set_clock(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.Armature   obj  = (DragonBones.Armature)o;
            DragonBones.WorldClock arg0 = (DragonBones.WorldClock)ToLua.CheckObject(L, 2, typeof(DragonBones.WorldClock));
            obj.clock = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index clock on a nil value" : e.Message));
        }
    }
    static int get_clock(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.Armature   obj = (DragonBones.Armature)o;
            DragonBones.WorldClock ret = obj.clock;
            ToLua.PushObject(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index clock on a nil value" : e.Message));
        }
    }
Beispiel #5
0
    static int get_clock(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.BaseFactory obj = (DragonBones.BaseFactory)o;
            DragonBones.WorldClock  ret = obj.clock;
            ToLua.PushObject(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index clock on a nil value"));
        }
    }
Beispiel #6
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;
        }
 /**
  * @private
  */
 public void _onRemove()
 {
     _clock = 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();
        }