mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-09 04:19:42 -05:00
UniVRM-0.103.1
This commit is contained in:
@@ -327,7 +327,7 @@ namespace VRM.SimpleViewer
|
||||
string[] cmds = System.Environment.GetCommandLineArgs();
|
||||
if (cmds.Length > 1)
|
||||
{
|
||||
LoadModelAsync(cmds[1]);
|
||||
LoadPathAsync(cmds[1]);
|
||||
}
|
||||
|
||||
m_texts.Start();
|
||||
@@ -391,10 +391,20 @@ namespace VRM.SimpleViewer
|
||||
return;
|
||||
}
|
||||
|
||||
LoadModelAsync(path);
|
||||
LoadPathAsync(path);
|
||||
}
|
||||
|
||||
async void LoadModelAsync(string path, byte[] bytes = null)
|
||||
async void LoadPathAsync(string path)
|
||||
{
|
||||
if (!File.Exists(path))
|
||||
{
|
||||
Debug.LogWarning($"{path} not exists");
|
||||
return;
|
||||
}
|
||||
LoadModelAsync(path, File.ReadAllBytes(path));
|
||||
}
|
||||
|
||||
async void LoadModelAsync(string path, byte[] bytes)
|
||||
{
|
||||
var size = bytes != null ? bytes.Length : 0;
|
||||
Debug.Log($"LoadModelAsync: {path}: {size}bytes");
|
||||
@@ -406,9 +416,10 @@ namespace VRM.SimpleViewer
|
||||
case ".glb":
|
||||
case ".zip":
|
||||
{
|
||||
var instance = await GltfUtility.LoadBytesAsync(path, bytes,
|
||||
var instance = await GltfUtility.LoadAsync(path,
|
||||
GetIAwaitCaller(m_useAsync.isOn),
|
||||
GetGltfMaterialGenerator(m_useUrpMaterial.isOn));
|
||||
SetModel(instance);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user