mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-14 14:29:52 -05:00
com.unity.cloud.ktxが無い場合にasyncメソッドでawaitが無い警告が出るのを抑制
com.unity.cloud.ktxが存在していない場合にそのままnullを返す実装に切り替わりますが、そのままだとasyncメソッドで一度もawaitしていないので次のようなコンパイラの警告が出てしまっていました。 ``` Assets/VRMShaders/GLTF/IO/Runtime/Texture/Importer/KtxTextureDeserializer.cs(14,38): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. ``` pragmaを用いて警告を抑制するようにしました。
This commit is contained in:
parent
9e9a8b0229
commit
43de5fa553
|
|
@ -10,7 +10,9 @@ namespace VRMShaders
|
|||
{
|
||||
public sealed class KtxTextureDeserializer : ITextureDeserializer
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
public async Task<Texture2D> LoadTextureAsync(DeserializingTextureInfo textureInfo, IAwaitCaller awaitCaller)
|
||||
#pragma warning restore 1998
|
||||
{
|
||||
#if USE_COM_UNITY_CLOUD_KTX
|
||||
if (textureInfo.ImageData == null) return null;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user