using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using XRTool.Util; #if UNITY_EDITOR using UnityEditor; namespace ShadowStudio.Util { public class AssetDatabaseLoader : Singleton, DataLoad { public UnityEngine.Object Load(string path) { return AssetDatabase.LoadAssetAtPath(path, typeof(UnityEngine.Object)); } public T Load(string path) where T : UnityEngine.Object { return AssetDatabase.LoadAssetAtPath(path); } public UnityEngine.Object Load(string path, Type systemTypeInstance) { return AssetDatabase.LoadAssetAtPath(path, systemTypeInstance); } public T[] LoadAll(string path) where T : UnityEngine.Object { return (T[])AssetDatabase.LoadAllAssetsAtPath(path); } public UnityEngine.Object[] LoadAll(string path, Type systemTypeInstance) { return AssetDatabase.LoadAllAssetsAtPath(path); } public UnityEngine.Object[] LoadAll(string path) { return AssetDatabase.LoadAllAssetsAtPath(path); } public LoadInfo LoadAsync(string path) where T : UnityEngine.Object { LoadInfo info = new LoadInfo(); var obj = Load(path); info.progress = 1; info.isDone = true; info.asset = obj; return info; } public LoadInfo LoadAsync(string path) { LoadInfo info = new LoadInfo(); var obj = Load(path); info.progress = 1; info.isDone = true; info.asset = obj; return info; } public LoadInfo LoadAsync(string path, Type type) { throw new NotImplementedException(); } public void UnloadAllAsset() { } public void UnloadAsset(UnityEngine.Object assetToUnload) { } } } #endif