diff --git a/Assets/VRM.Samples/Scripts/ViewerUI.cs b/Assets/VRM.Samples/Scripts/ViewerUI.cs index bb640dbe4..6de3d72ca 100644 --- a/Assets/VRM.Samples/Scripts/ViewerUI.cs +++ b/Assets/VRM.Samples/Scripts/ViewerUI.cs @@ -264,7 +264,7 @@ namespace VRM.Samples void OnOpenClicked() { #if UNITY_STANDALONE_WIN - var path = FileDialogForWindows.FileDialog("open VRM", "vrm", "glb", "bvh"); + var path = FileDialogForWindows.FileDialog("open VRM", "vrm", "glb", "bvh", "gltf", "zip"); #elif UNITY_EDITOR var path = UnityEditor.EditorUtility.OpenFilePanel("Open VRM", "", "vrm"); #else @@ -281,6 +281,7 @@ namespace VRM.Samples case ".gltf": case ".glb": case ".vrm": + case ".zip": LoadModel(path); break; @@ -328,6 +329,19 @@ namespace VRM.Samples break; } + case ".gltf": + case ".zip": + { + var context = new UniGLTF.ImporterContext(); + context.Parse(path); + context.Load(); + context.ShowMeshes(); + context.EnableUpdateWhenOffscreen(); + context.ShowMeshes(); + SetModel(context.Root); + break; + } + default: Debug.LogWarningFormat("unknown file type: {0}", path); break;