From 2ec90edf665fc48e4b459f5419582ed86e2ae8d5 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Wed, 5 Oct 2022 14:47:54 +0900 Subject: [PATCH] Rewrite `??=`. This is cause `CS1525: Invalid expression term '='` in Unity-2019. #1840 --- .../Runtime/UniGLTF/IO/TextureIO/GltfTextureImporter.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/TextureIO/GltfTextureImporter.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/TextureIO/GltfTextureImporter.cs index 27cdef130..753cecb1a 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/TextureIO/GltfTextureImporter.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/TextureIO/GltfTextureImporter.cs @@ -151,7 +151,10 @@ namespace UniGLTF { name = TextureImportName.GetUnityObjectName(TextureImportTypes.StandardMap, gltfTexture.name, gltfImage.uri); } - sampler ??= TextureSamplerUtil.CreateSampler(data.GLTF, occlusionTextureIndex.Value); + if (sampler == null) + { + sampler = TextureSamplerUtil.CreateSampler(data.GLTF, occlusionTextureIndex.Value); + } getOcclusionAsync = () => Task.FromResult(GetImageBytesFromImageIndex(data, imageIndex.Value)); } }