修复clip内存泄漏
This commit is contained in:
@@ -40,9 +40,12 @@ export class AnimationClipUtils {
|
||||
let sample = data.sample ? data.sample : 8;
|
||||
let wrapMode = data.wrapMode ? data.wrapMode : AnimationClip.WrapMode.Normal;
|
||||
|
||||
let idx = animation.clips.findIndex((clip)=>{ return clip.name == data.name});
|
||||
if (idx >= 0)
|
||||
let idx = animation.clips.findIndex((clip) => { return clip.name == data.name });
|
||||
if (idx >= 0) {
|
||||
let clip = animation.clips[idx];
|
||||
animation.removeClip(animation.clips[idx], force);
|
||||
clip.destroy();
|
||||
}
|
||||
let spriteAtlas = ResLoader.ins().get(data.path, SpriteAtlas, bundle);
|
||||
if (!spriteAtlas)
|
||||
spriteAtlas = await ResLoader.ins().loadAsync(bundle, data.path, SpriteAtlas);
|
||||
|
||||
Reference in New Issue
Block a user