This commit is contained in:
ousttrue 2020-06-15 16:58:43 +09:00
parent 77e1e673f3
commit 8b4bae8141
2 changed files with 17 additions and 1 deletions

View File

@ -57,6 +57,14 @@ namespace UniGLTF
return -1;
}
#if UNITY_EDITOR
if (!string.IsNullOrEmpty(UnityEditor.AssetDatabase.GetAssetPath(texture)))
{
m_exportTextures[index] = texture;
return index;
}
#endif
// ToDo: may already exists
m_exportTextures[index] = TextureItem.CopyTexture(texture, readWrite, null);

View File

@ -129,7 +129,15 @@ namespace UniGLTF
Bytes = System.IO.File.ReadAllBytes(path.FullPath),
Mime = "image/png",
};
}
}
if (path.Extension == ".jpg")
{
return new BytesWithMime
{
Bytes = System.IO.File.ReadAllBytes(path.FullPath),
Mime = "image/jpeg",
};
}
}
#endif