From 43de5fa553da4b85ffe41b0593d984bd883f8876 Mon Sep 17 00:00:00 2001 From: Isamu Mogi Date: Thu, 6 Jun 2024 23:59:01 +0900 Subject: [PATCH] =?UTF-8?q?com.unity.cloud.ktx=E3=81=8C=E7=84=A1=E3=81=84?= =?UTF-8?q?=E5=A0=B4=E5=90=88=E3=81=ABasync=E3=83=A1=E3=82=BD=E3=83=83?= =?UTF-8?q?=E3=83=89=E3=81=A7await=E3=81=8C=E7=84=A1=E3=81=84=E8=AD=A6?= =?UTF-8?q?=E5=91=8A=E3=81=8C=E5=87=BA=E3=82=8B=E3=81=AE=E3=82=92=E6=8A=91?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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を用いて警告を抑制するようにしました。 --- .../GLTF/IO/Runtime/Texture/Importer/KtxTextureDeserializer.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Assets/VRMShaders/GLTF/IO/Runtime/Texture/Importer/KtxTextureDeserializer.cs b/Assets/VRMShaders/GLTF/IO/Runtime/Texture/Importer/KtxTextureDeserializer.cs index 05f38d67b..c53ea6809 100644 --- a/Assets/VRMShaders/GLTF/IO/Runtime/Texture/Importer/KtxTextureDeserializer.cs +++ b/Assets/VRMShaders/GLTF/IO/Runtime/Texture/Importer/KtxTextureDeserializer.cs @@ -10,7 +10,9 @@ namespace VRMShaders { public sealed class KtxTextureDeserializer : ITextureDeserializer { +#pragma warning disable 1998 public async Task LoadTextureAsync(DeserializingTextureInfo textureInfo, IAwaitCaller awaitCaller) +#pragma warning restore 1998 { #if USE_COM_UNITY_CLOUD_KTX if (textureInfo.ImageData == null) return null;