/// <summary> /// 初始化 /// </summary> /// <param name="loadType"></param> /// <param name="useCache"></param> public static void Init(AssetsLoadType loadType, bool useCache) { if (s_isInit) { return; } s_isInit = true; if (loadType == AssetsLoadType.AssetBundle) { useCache = true; } if (!Application.isPlaying) { useCache = false; } UseCache = useCache; ResourcesManager.m_loadType = loadType; ReleaseAll(); //GameInfoCollecter.AddAppInfoValue("AssetsLoadType", loadType); loadAssetsController = new AssetsLoadController(loadType, useCache); //Debug.LogError("ResourceManager初始化 AssetsLoadType:" + loadType + " useCache:" + useCache + loadAssetsController==null); }
public AssetsLoadController(AssetsLoadType loadType, bool useCache) { m_loadType = loadType; m_useCache = useCache; if (loadType == AssetsLoadType.Resources) { loader = new ResourcesLoader(this); } }
public AssetsLoadController(AssetsLoadType loadType) { this.loadType = loadType; if (loadType == AssetsLoadType.Resources) { loader = new ResourcesLoader(this); } else { loader = new AssetBundleLoader(this); } }
/// <summary> /// 获取加载路径 /// </summary> /// <param name="bundleName"></param> /// <returns></returns> public static string GetLoadPath(AssetsLoadType assetsLoadType, string path) { //string path = GetResourcePath(name); if (assetsLoadType == AssetsLoadType.Resources) { return(path); } else { return(GetLoadPathBase(assetsLoadType, path)); } }
public static string GetLoadPath(AssetsLoadType assetsloadType, string name) { string path = string.Empty; if (assetsloadType == AssetsLoadType.Resources) { path = GetAbsolutePath(ResLoadLocation.Resource, name); } else { path = GetAssetsBundlePersistentPath() + path; } return(path); }
/// <summary> /// 初始化 /// </summary> /// <param name="loadType"></param> /// <param name="useCache"></param> public static void Initialize(AssetsLoadType loadType, bool useCache) { //if (isInit) // return; if (loadType == AssetsLoadType.AssetBundle) { useCache = true; } if (!Application.isPlaying) { useCache = false; } UseCache = useCache; ResourceManager.loadType = loadType; ReleaseAll(); loadAssetsController = new AssetsLoadController(loadType, useCache); //Debug.Log("ResourceManager初始化 AssetsLoadType:" + loadType + " useCache:" + useCache); }
public static string GetLoadPathBase(AssetsLoadType assetsloadType, string path) { //#if !UNITY_WEBGL bool isLoadByPersistent = RecordManager.GetData(HotUpdateManager.c_HotUpdateRecordName).GetRecord(path, "null") == "null" ? false : true; ResLoadLocation loadType = ResLoadLocation.Streaming; //加载路径由 加载根目录 和 相对路径 合并而成 //加载根目录由配置决定 if (isLoadByPersistent) { loadType = ResLoadLocation.Persistent; return(PathTool.GetAssetsBundlePersistentPath() + path); } else { loadType = ResLoadLocation.Streaming; return(PathTool.GetAbsolutePath(loadType, path)); } //#else // return PathTool.GetLoadURL(config.path + "." + c_AssetsBundlesExpandName); //#endif }
/// <summary> /// TodoAssetBundle资源加载 /// </summary> /// <param name="assetsloadType"></param> /// <param name="path"></param> /// <returns></returns> public static string GetLoadPathBase(AssetsLoadType assetsloadType, string path) { return(""); }
private void InitLoadType() { loadType = Application.platform == RuntimePlatform.WindowsEditor ? AssetsLoadType.Resources : AssetsLoadType.AssetBundle; loadController = new AssetsLoadController(loadType); }