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:
Isamu Mogi 2024-06-06 23:59:01 +09:00
parent 9e9a8b0229
commit 43de5fa553

View File

@ -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;