求助官方,脚本创建 animation 不能释放,再次载入还是上次加载的资源

代码奉上!

var animation = this.cache_image.getComponent(cc.Animation);
animation.stop();
animation.removeClip(‘anim_run’);

    var spriteFrames;

    var deps = cc.loader.getDependsRecursively('record');
    cc.loader.release(deps);

    cc.loader.loadResDir('record', function (err, assets) {
        if (err) {
            cc.error(err);
            return;
        }
        spriteFrames = assets;

        var clip = cc.AnimationClip.createWithSpriteFrames(spriteFrames, 17);
        clip.name = "anim_run";
        clip.wrapMode = cc.WrapMode.Loop;
        animation.addClip(clip);
        animation.play('anim_run');
    });

loadResArray 问题依旧

this.cache_image 有Animation属性

目前需要实现动态加载resources/record 文件夹下的资源,
文件夹里面的jpg会不定时更新

demo.rar (1.7 MB)

参考下这个帖子,看看有没有用
http://forum.cocos.com/t/prefab/53941

打包后resources里的文件,无法更改吧?

可以试试读取外部图片的方式来做

谢谢楼上的朋友,我这个需要把图片加载成序列帧,请问有什么办法吗?

cc.AnimationClip.createWithSpriteFrames(spriteFrames

就这个api,spriteFrames是个数组,把你的序列帧图片,按顺序放进这个数组就行了