一套资源管理工具
由 QFramework 团队官方维护的独立工具包(不依赖 QFramework)。
- Unity 2018.4LTS
- PackageManager
- add from package git url:https://github.com/liangxiegame/ResKit.git
- 或者国内镜像仓库:https://gitee.com/liangxiegame/ResKit.git
- 或者点此下载 ResKit.unitypackage 并安装到自己项目中的任意脚本中
// allocate a loader when initialize a panel or a monobehavour
var loader = ResLoader.Allocate();
// load someth in a panel or a monobehaviour
loader.LoadSync<GameObject>("resources://smobj");
loader.LoadSync<Texture2D>("resources://Bg");
// load by asset bundle's assetName
loader.LoadSync<Texture2D>("HomeBg");
// load by asset bundle name and assetName
loader.LoadSync<Texture2D>("home","HomeBg");
// resycle this panel/monobehaivour's loaded res when destroyed
loader.Recycle2Cache();
loader = null;