Skip to content

save content using cc.Asset._nativeAsset.setter, add handler of '.bin'#3935

Merged
pandamicro merged 2 commits intococos:v2.0-releasefrom
SantyWang:v2.0-release
Mar 12, 2019
Merged

save content using cc.Asset._nativeAsset.setter, add handler of '.bin'#3935
pandamicro merged 2 commits intococos:v2.0-releasefrom
SantyWang:v2.0-release

Conversation

@SantyWang
Copy link
Copy Markdown
Contributor

@SantyWang SantyWang commented Feb 28, 2019

Re: cocos-creator/2d-tasks#1170

Changes:

  • save content
  • loadResDir should not return all spriteFrame of SpriteAtlas

@SantyWang
Copy link
Copy Markdown
Contributor Author

参考#2981
参考https://github.com/cocos-creator/fireball/issues/6757

现在用户释放资源基本都是用getDependsRecursively先获取依赖再传递给release函数,感觉没有必要返回spriteAtlas的spriteFrame在一个数组里了

@jareguo
Copy link
Copy Markdown
Contributor

jareguo commented Mar 1, 2019

这样修改后,之前的 example 需要同步调整,也采用
getDependsRecursively 释放图集才行。 @ColinCollins

@pandamicro pandamicro requested a review from ColinCollins March 9, 2019 15:35
@pandamicro pandamicro merged commit eddc005 into cocos:v2.0-release Mar 12, 2019
@jareguo
Copy link
Copy Markdown
Contributor

jareguo commented May 9, 2019

现在用户释放资源基本都是用getDependsRecursively先获取依赖再传递给release函数,感觉没有必要返回spriteAtlas的spriteFrame在一个数组里了

其实当初那么改,主要原因也不是为了方便 release,而是为了保持行为和其它的 sub asset(如 texture -> sprite frame) 一致。loadResDir 总是会返回所有的子资源。
要说 loadResDir 那样改有什么问题?主要倒还是忽略了对 type 的判断,如果 type 定义为非 SpriteFrame,那么就不应该自行添加 SpriteFrame。


重新想了一下,这里始终不会有特别统一的解决方法。日后有需要的话再采用类似 AssetBundle 的方案替代吧

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants