mirror of
https://gitee.com/dgflash/oops-plugin-framework.git
synced 2026-06-30 07:24:26 +08:00
音乐资源释放时,同时释放AudioClip对象
This commit is contained in:
@@ -64,7 +64,9 @@ export class AudioEffect extends AudioSource {
|
||||
*/
|
||||
release(url: string) {
|
||||
if (this.effects.has(url)) {
|
||||
var ac = this.effects.get(url);
|
||||
this.effects.delete(url);
|
||||
ac?.destroy();
|
||||
oops.res.release(url);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,6 +81,7 @@ export class AudioMusic extends AudioSource {
|
||||
/** 释放当前背景音乐资源 */
|
||||
release() {
|
||||
if (this._url) {
|
||||
this.clip?.destroy();
|
||||
oops.res.release(this._url);
|
||||
this._url = null!;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user