mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-20 01:37:59 -05:00
Merge pull request #433 from ousttrue/exporter_use_jpg
EditorExport時にアセットが見つかったTextureは、それを使う
This commit is contained in:
commit
7a7925d375
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user