肉肉七七

关注

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

肉肉七七

关注

阅读 54

2022-03-11

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


    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];
    }

相关推荐

大柚子top

cocos creator 之 资源系统

大柚子top 54 0 0

艾米吖

Cocos Creator实现的《点我+1》

艾米吖 9 0 0

云上笔记

Cocos Creator Protobuf的js版本使用

云上笔记 168 0 0

small_Sun

Cocos Creator开发中的instantiate方法小结

small_Sun 85 0 0

Soy丶sauce

Cocos Creator之不规则的点击区域

Soy丶sauce 37 0 0

钎探穗

cocos creator屏幕适配的3个妙招

钎探穗 36 0 0

读思意行

Cocos Creator之Label,RichText 的强制刷新

读思意行 155 0 0

野见

【Cocos Creator 系列教程之一】CC尝鲜小总结及组件使用需注意的几点细节

野见 188 0 0

肉肉七七

麒麟子Cocos Creator 3D研究笔记一:图片资源类型和加载

肉肉七七 95 0 0

ITWYY

[WinForm] UserControl 释放资源的 OnHandleDestroyed 事件

ITWYY 46 0 0

精彩评论(0)

0 0 举报