diff options
author | chai <215380520@qq.com> | 2023-05-12 10:32:11 +0800 |
---|---|---|
committer | chai <215380520@qq.com> | 2023-05-12 10:32:11 +0800 |
commit | 2fc9585797067730f28b03b0727bf05f9deed091 (patch) | |
tree | 8807e37b85ba922045eaa17ac445dd0a1d2d730c /WorldlineKeepers/Assets/Scripts/Managers/ResourceManager.cs | |
parent | 2a1cd4fda8a4a8e649910d16b4dfa1ce7ae63543 (diff) |
+ worldline keepers
Diffstat (limited to 'WorldlineKeepers/Assets/Scripts/Managers/ResourceManager.cs')
-rw-r--r-- | WorldlineKeepers/Assets/Scripts/Managers/ResourceManager.cs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/WorldlineKeepers/Assets/Scripts/Managers/ResourceManager.cs b/WorldlineKeepers/Assets/Scripts/Managers/ResourceManager.cs new file mode 100644 index 0000000..4b318ca --- /dev/null +++ b/WorldlineKeepers/Assets/Scripts/Managers/ResourceManager.cs @@ -0,0 +1,32 @@ +using System.Collections; +using System.Collections.Generic; +#if UNITY_EDITOR +using UnityEditor; +#endif +using UnityEngine; + +namespace WK +{ + + public class ResourceManager : Singleton<ResourceManager> + { + + // 资源根目录是Assets/Bundle/,后续可能会把部分资源移动到streamingAssets目录 + public const string kAssetRoot = "Assets/Bundle/"; + + public T LoadAsset<T>(string relativePath) where T : UnityEngine.Object + { +#if UNITY_EDITOR + string path = kAssetRoot + relativePath; + T obj = AssetDatabase.LoadAssetAtPath(path, typeof(T)) as T; + return obj; +#else + return null ; +#endif + } + + + + } + +} |