Merge pull request #613 from momoandbanana22/casterr

fix cast error
This commit is contained in:
ousttrue 2020-11-16 14:08:55 +09:00 committed by GitHub
commit 8a3e668f36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -123,7 +123,7 @@ namespace UniGLTF
var path = UnityPath.FromAsset(texture);
if (path.IsUnderAssetsFolder)
{
var textureImporter = (TextureImporter) AssetImporter.GetAtPath(path.Value);
var textureImporter = AssetImporter.GetAtPath(path.Value) as TextureImporter;
var getSizeMethod = typeof(TextureImporter).GetMethod("GetWidthAndHeight", BindingFlags.NonPublic | BindingFlags.Instance);
if (textureImporter != null && getSizeMethod != null)
{