UNITASK_ASSETBUNDLE_SUPPORT #131
parent
6ec0ed8d61
commit
a72ceeba11
|
@ -10,6 +10,11 @@
|
|||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [
|
||||
{
|
||||
"name": "com.unity.modules.assetbundle",
|
||||
"expression": "",
|
||||
"define": "UNITASK_ASSETBUNDLE_SUPPORT"
|
||||
}
|
||||
],
|
||||
"noEngineReferences": false
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
|
||||
|
||||
#if UNITY_2018_4 || UNITY_2019_4_OR_NEWER
|
||||
#if UNITASK_ASSETBUNDLE_SUPPORT
|
||||
|
||||
using Cysharp.Threading.Tasks.Internal;
|
||||
using System;
|
||||
|
@ -313,3 +314,4 @@ namespace Cysharp.Threading.Tasks
|
|||
}
|
||||
|
||||
#endif
|
||||
#endif
|
|
@ -605,6 +605,7 @@ namespace Cysharp.Threading.Tasks
|
|||
|
||||
#endregion
|
||||
|
||||
#if UNITASK_ASSETBUNDLE_SUPPORT
|
||||
#region AssetBundleRequest
|
||||
|
||||
public static AssetBundleRequestAwaiter GetAwaiter(this AssetBundleRequest asyncOperation)
|
||||
|
@ -906,7 +907,9 @@ namespace Cysharp.Threading.Tasks
|
|||
}
|
||||
|
||||
#endregion
|
||||
#endif
|
||||
|
||||
#if UNITASK_ASSETBUNDLE_SUPPORT
|
||||
#region AssetBundleCreateRequest
|
||||
|
||||
public static AssetBundleCreateRequestAwaiter GetAwaiter(this AssetBundleCreateRequest asyncOperation)
|
||||
|
@ -1208,6 +1211,7 @@ namespace Cysharp.Threading.Tasks
|
|||
}
|
||||
|
||||
#endregion
|
||||
#endif
|
||||
|
||||
#if ENABLE_UNITYWEBREQUEST
|
||||
#region UnityWebRequestAsyncOperation
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
Func<string, string> ToUniTaskReturnType = x => (x == "void") ? "UniTask" : $"UniTask<{x}>";
|
||||
Func<string, string> ToIUniTaskSourceReturnType = x => (x == "void") ? "IUniTaskSource" : $"IUniTaskSource<{x}>";
|
||||
Func<(string typeName, string returnType, string returnField), bool> IsUnityWebRequest = x => x.returnType == "UnityWebRequest";
|
||||
Func<(string typeName, string returnType, string returnField), bool> IsAssetBundleModule = x => x.typeName == "AssetBundleRequest" || x.typeName == "AssetBundleCreateRequest";
|
||||
Func<(string typeName, string returnType, string returnField), bool> IsVoid = x => x.returnType == "void";
|
||||
#>
|
||||
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
|
||||
|
@ -37,6 +38,8 @@ namespace Cysharp.Threading.Tasks
|
|||
<# foreach(var t in types) { #>
|
||||
<# if(IsUnityWebRequest(t)) { #>
|
||||
#if ENABLE_UNITYWEBREQUEST
|
||||
<# } else if(IsAssetBundleModule(t)) { #>
|
||||
#if UNITASK_ASSETBUNDLE_SUPPORT
|
||||
<# } #>
|
||||
#region <#= t.typeName #>
|
||||
|
||||
|
@ -422,7 +425,7 @@ namespace Cysharp.Threading.Tasks
|
|||
}
|
||||
|
||||
#endregion
|
||||
<# if(IsUnityWebRequest(t)) { #>
|
||||
<# if(IsUnityWebRequest(t) || IsAssetBundleModule(t)) { #>
|
||||
#endif
|
||||
<# } #>
|
||||
|
||||
|
|
Loading…
Reference in New Issue