public static T EditorLoad <T>(string name) where T : Object { T res = null; string path = ResourcesConfigManager.GetLoadPath(AssetsLoadType.Resources, name); res = Resources.Load <T>(path); return(res); }
/// <summary> /// 同步加载一个资源 /// </summary> /// <param name="name"></param> public static Object Load(string name) { string path = ResourcesConfigManager.GetLoadPath(loadType, name); AssetsData assets = loadAssetsController.LoadAssets(path); if (assets != null) { return(assets.Assets[0]); } return(null); }
public static void DestoryAssetsCounter(string name, int times = 1) { if (!ResourcesConfigManager.GetIsExitRes(name)) { return; } string path = ResourcesConfigManager.GetLoadPath(loadType, name); if (times <= 0) { times = 1; } for (int i = 0; i < times; i++) { loadAssetsController.DestoryAssetsCounter(path); } }
/// <summary> /// 加载资源 /// 注意释放资源,方法: DestoryAssetsCounter /// </summary> /// <typeparam name="T"></typeparam> /// <param name="name"></param> /// <returns></returns> public static T Load <T>(string name) where T : Object { T res = null; string path = ResourcesConfigManager.GetLoadPath(loadType, name); //Debug.Log("ResourcesConfigManager.GetLoadPath :"+ path); AssetsData assets = loadAssetsController.LoadAssets <T>(path); if (assets != null) { res = assets.GetAssets <T>(); } if (res == null) { Debug.LogError("Error=> Load Name :" + name + " Type:" + typeof(T).FullName + "\n" + " Load Object:" + res); } return(res); }
public static void LoadAsync(string name, Type resType, CallBack <Object> callBack) { string path = ResourcesConfigManager.GetLoadPath(loadType, name); loadAssetsController.LoadAsync(path, resType, callBack); }
public static void Release(string name) { string path = ResourcesConfigManager.GetLoadPath(loadType, name); loadAssetsController.Release(path); }