123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- 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<AssetDatabaseLoader>, DataLoad
- {
- public UnityEngine.Object Load(string path)
- {
- return AssetDatabase.LoadAssetAtPath(path, typeof(UnityEngine.Object));
- }
- public T Load<T>(string path) where T : UnityEngine.Object
- {
- return AssetDatabase.LoadAssetAtPath<T>(path);
- }
- public UnityEngine.Object Load(string path, Type systemTypeInstance)
- {
- return AssetDatabase.LoadAssetAtPath(path, systemTypeInstance);
- }
- public T[] LoadAll<T>(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<T>(string path) where T : UnityEngine.Object
- {
- LoadInfo info = new LoadInfo();
- var obj = Load<T>(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
|