[]CameraMoveScript,父对象Camera移除removeAllComponent后,还会继续获取鼠标事件
this.m_scene = new Laya.Scene();
this.m_sceneCamera = new Laya.Camera(0, 0.1, 100);
this.m_sceneCamera.transform.translate(new Laya.Vector3(-40, 50, 60));
this.m_sceneCamera.clearFlag = Laya.BaseCamera.CLEARFLAG_SKY;
this.m_sceneCamera.addComponent(CameraMoveScript);
this.stage.addChild(this.m_scene);
this.m_scene.addChild(this.m_sceneCamera);
在destory的时候
this.stage.removeChild(this.m_scene);
this.m_sceneCamera.removeAllComponent();
this.m_scene.destroy();
this.m_scene = null;
只会这个CameraMoveSprite还会被触发鼠标事件,然后就崩溃了
this.m_sceneCamera = new Laya.Camera(0, 0.1, 100);
this.m_sceneCamera.transform.translate(new Laya.Vector3(-40, 50, 60));
this.m_sceneCamera.clearFlag = Laya.BaseCamera.CLEARFLAG_SKY;
this.m_sceneCamera.addComponent(CameraMoveScript);
this.stage.addChild(this.m_scene);
this.m_scene.addChild(this.m_sceneCamera);
在destory的时候
this.stage.removeChild(this.m_scene);
this.m_sceneCamera.removeAllComponent();
this.m_scene.destroy();
this.m_scene = null;
只会这个CameraMoveSprite还会被触发鼠标事件,然后就崩溃了
没有找到相关结果
已邀请:
要回复问题请先登录
1 个回复
Monica - 知识达人
赞同来自: