0
点赞
收藏
分享

微信扫一扫

【cocos creator】释放不用的资源 cc.assetManager.releaseAsset

释放前要检查该资源有没有在游戏中被引用


    clear_Audio(url) {
        let count = 0;
        for (let t in this.questionData) {
            let element = this.questionData[t];
            if (element.audio_url == url) {
                count++;
            }
        }
        if (count) return;
        cc.assetManager.releaseAsset(this.gameAudioClips[url]);
        delete this.gameAudioClips[url];
    }
举报

相关推荐

0 条评论