zfree ymsdandan //开启节点destroy 事件LayaPatch.Enable_NodeDestroyEvent = function(){ var oldDestroy = Laya.Node.prototype.destroy; Laya.Node.prototype.destroy = function(){ this.event('destroy'); oldDestroy.call(this); } }
zfree //开启节点destroy 事件 LayaPatch.Enable_NodeDestroyEvent = function(){ var oldDestroy = Laya.Node.prototype.destroy; Laya.Node.prototype.destroy = function(){ this.event('destroy'); oldDestroy.call(this); } }
Monica 你直接在销毁的时候派发一个自定义事件,然后把销毁页面之后的逻辑写到对应的回调函数即可。关于自定义事件的例子你可以看下我这个Demo:https://ask.layabox.com/question/3957