Merge pull request #1846 from ousttrue/fix_unity_2019

[Unity-2019] fix `??=`.
This commit is contained in:
ousttrue 2022-10-07 13:04:13 +09:00 committed by GitHub
commit b51bab85fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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