[]clearRes好像没作用,或许我的用法不对

刚才代码路径有误,更正如下    
constructor() {
        super();
        Laya.stage.on(Laya.Event.KEY_UP, this, this.onKeyUp);
    }
    onKeyUp(e: Laya.Event) {

        if (e.keyCode == 65) {//A
            console.log("释放资源false")
            Laya.loader.clearRes("res/atlas/comp.json", false);
            Laya.loader.clearRes("res/atlas/comp.png", false);
        }
        if (e.keyCode == 66) {//B
            console.log("释放资源 true")
            Laya.loader.clearRes("res/atlas/comp.json", true);
            Laya.loader.clearRes("res/atlas/comp.png", true);
        }
        if (e.keyCode == 67) {//C
            this.testimg.skin = "comp/bg.png";
        }
    }
点击键盘A,B并没有发现内存变化(这不是预期结果)
点击键盘C,改变skin确实找不到资源了(这是预期的结果)
已邀请:

要回复问题请先

商务合作
商务合作