Update YooAssets.cs

Add IsInitialized filed
pull/15/head
hevinci 2022-06-20 15:38:55 +08:00
parent 746fa44ab8
commit 9cea3e1ba9
1 changed files with 13 additions and 4 deletions

View File

@ -117,6 +117,15 @@ namespace YooAsset
private static OfflinePlayModeImpl _offlinePlayModeImpl; private static OfflinePlayModeImpl _offlinePlayModeImpl;
private static HostPlayModeImpl _hostPlayModeImpl; private static HostPlayModeImpl _hostPlayModeImpl;
/// <summary>
/// 是否已经初始化
/// </summary>
public static bool IsInitialized
{
get { return _isInitialize; }
}
/// <summary> /// <summary>
/// 异步初始化 /// 异步初始化
/// </summary> /// </summary>
@ -522,7 +531,7 @@ namespace YooAsset
/// </summary> /// </summary>
/// <typeparam name="TObject">资源类型</typeparam> /// <typeparam name="TObject">资源类型</typeparam>
/// <param name="location">资源的定位地址</param> /// <param name="location">资源的定位地址</param>
public static AssetOperationHandle LoadAssetSync<TObject>(string location) where TObject : class public static AssetOperationHandle LoadAssetSync<TObject>(string location) where TObject : UnityEngine.Object
{ {
DebugCheckInitialize(); DebugCheckInitialize();
AssetInfo assetInfo = ConvertLocationToAssetInfo(location, typeof(TObject)); AssetInfo assetInfo = ConvertLocationToAssetInfo(location, typeof(TObject));
@ -557,7 +566,7 @@ namespace YooAsset
/// </summary> /// </summary>
/// <typeparam name="TObject">资源类型</typeparam> /// <typeparam name="TObject">资源类型</typeparam>
/// <param name="location">资源的定位地址</param> /// <param name="location">资源的定位地址</param>
public static AssetOperationHandle LoadAssetAsync<TObject>(string location) public static AssetOperationHandle LoadAssetAsync<TObject>(string location) where TObject : UnityEngine.Object
{ {
DebugCheckInitialize(); DebugCheckInitialize();
AssetInfo assetInfo = ConvertLocationToAssetInfo(location, typeof(TObject)); AssetInfo assetInfo = ConvertLocationToAssetInfo(location, typeof(TObject));
@ -602,7 +611,7 @@ namespace YooAsset
/// </summary> /// </summary>
/// <typeparam name="TObject">资源类型</typeparam> /// <typeparam name="TObject">资源类型</typeparam>
/// <param name="location">资源的定位地址</param> /// <param name="location">资源的定位地址</param>
public static SubAssetsOperationHandle LoadSubAssetsSync<TObject>(string location) public static SubAssetsOperationHandle LoadSubAssetsSync<TObject>(string location) where TObject : UnityEngine.Object
{ {
DebugCheckInitialize(); DebugCheckInitialize();
AssetInfo assetInfo = ConvertLocationToAssetInfo(location, typeof(TObject)); AssetInfo assetInfo = ConvertLocationToAssetInfo(location, typeof(TObject));
@ -637,7 +646,7 @@ namespace YooAsset
/// </summary> /// </summary>
/// <typeparam name="TObject">资源类型</typeparam> /// <typeparam name="TObject">资源类型</typeparam>
/// <param name="location">资源的定位地址</param> /// <param name="location">资源的定位地址</param>
public static SubAssetsOperationHandle LoadSubAssetsAsync<TObject>(string location) public static SubAssetsOperationHandle LoadSubAssetsAsync<TObject>(string location) where TObject : UnityEngine.Object
{ {
DebugCheckInitialize(); DebugCheckInitialize();
AssetInfo assetInfo = ConvertLocationToAssetInfo(location, typeof(TObject)); AssetInfo assetInfo = ConvertLocationToAssetInfo(location, typeof(TObject));