mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-12 13:59:21 -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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user