using System.Collections; using System.Collections.Generic; #if UNITY_EDITOR using UnityEditor; #endif using UnityEngine; namespace WK { public class ResourceManager : Singleton { // 资源根目录是Assets/Bundle/,后续可能会把部分资源移动到streamingAssets目录 public const string kAssetRoot = "Assets/Bundle/"; public T LoadAsset(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 } } }