public static Object Load(string path, System.Type type) { ABRequest req = LoadAB(path); if (req == null) { return(null); } else { return(req.Load(type)); } }
static ABRequest GetABRequest(string path) { initEditorCacheList(); ABRequest result = null; if (editorCacheList.ContainsKey(path)) { result = editorCacheList[path]; result.AddUseCount(); } return(result); }
private static void initEditorCacheList() { if (editorCacheList.Count == 0) { System.IO.DirectoryInfo resources = new System.IO.DirectoryInfo(String.Concat(System.Environment.CurrentDirectory, System.IO.Path.DirectorySeparatorChar, ABHelper.ResourcesPath)); System.IO.FileInfo[] allFiles = resources.GetFiles("*.*", System.IO.SearchOption.AllDirectories); for (int i = 0; i < allFiles.Length; i++) { System.IO.FileInfo info = allFiles[i]; if (info.Extension != ".meta") { string assetPath = info.FullName.Substring(resources.FullName.Length + 1); #if UNITY_EDITOR_WIN assetPath = assetPath.Replace(System.IO.Path.DirectorySeparatorChar, '/'); #endif string pathName = assetPath.Substring(0, assetPath.Length - info.Extension.Length); ABRequest item = new ABRequest(pathName, string.Concat(ABHelper.ResourcesPath, "/", assetPath)); item.IsDone = true; editorCacheList[pathName] = item; } } } }