mirror of
https://gitee.com/dgflash/oops-plugin-framework.git
synced 2026-05-07 19:07:30 +08:00
GameComponent.playEffect方法中删除音效播放器唯一id数据,减小一个场景反复使用音效时重复记录资源数据
This commit is contained in:
@@ -342,14 +342,14 @@ export class GameComponent extends Component {
|
||||
*/
|
||||
async playEffect(url: string, bundleName?: string) {
|
||||
if (bundleName == null) bundleName = oops.res.defaultBundleName;
|
||||
const id = await oops.audio.playEffect(url, bundleName, () => {
|
||||
await oops.audio.playEffect(url, bundleName, () => {
|
||||
const rps = this.resPaths.get(ResType.Audio);
|
||||
if (rps) {
|
||||
const key = this.getResKey(bundleName, url, id);
|
||||
const key = this.getResKey(bundleName, url);
|
||||
rps.delete(key);
|
||||
}
|
||||
});
|
||||
this.addPathToRecord(ResType.Audio, bundleName, url, id);
|
||||
this.addPathToRecord(ResType.Audio, bundleName, url);
|
||||
}
|
||||
//#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user