public void Init(EResMgrType type, string assetRoot = null) { switch (type) { case EResMgrType.ASSET_BUNDLE: Debug.Log(Log.Zero1("初始化资源管理器... 资源来源:[AssetBundle] Manifest路径:{0}", assetRoot)); var newMgr = new AssetBundleResMgr(assetRoot); if (_mgr != null && _mgr is AssetBundleResMgr) { //替换旧的需要继承一下已加载字典 newMgr.Inherit(_mgr as AssetBundleResMgr); } _mgr = newMgr; break; case EResMgrType.RESOURCES: Debug.Log(Log.Zero1("初始化资源管理器... 资源来源:[Resources]")); _mgr = new ResourcesResMgr(); break; case EResMgrType.ASSET_DATA_BASE: Debug.Log(Log.Zero1("初始化资源管理器... 资源来源:[AssetDataBase] 资源根目录:{0}", assetRoot)); _mgr = new AssetDataBaseResMgr(assetRoot); break; } }
public void Init(EResMgrType type, string manifestFilePath) { switch (type) { case EResMgrType.ASSET_BUNDLE: Log.CI(Log.COLOR_BLUE, "初始化资源管理器... 资源来源:[AssetBundle] Manifest路径:{0}", manifestFilePath); _mgr = new AssetBundleResMgr(manifestFilePath); break; case EResMgrType.RESOURCES: Log.CI(Log.COLOR_BLUE, "初始化资源管理器... 资源来源:[Resources]"); _mgr = new ResourcesResMgr(manifestFilePath); break; } }