diff --git a/Assets/VRM.Samples/Scripts/VRMRuntimeExporter.cs b/Assets/VRM.Samples/Scripts/VRMRuntimeExporter.cs index 2133365bf..7da329032 100644 --- a/Assets/VRM.Samples/Scripts/VRMRuntimeExporter.cs +++ b/Assets/VRM.Samples/Scripts/VRMRuntimeExporter.cs @@ -32,6 +32,8 @@ namespace VRM.Samples { #if UNITY_STANDALONE_WIN var path = FileDialogForWindows.FileDialog("open VRM", ".vrm"); +#elif UNITY_EDITOR + var path = UnityEditor.EditorUtility.OpenFilePanel("Open VRM", "", "vrm"); #else var path = Application.dataPath + "/default.vrm"; #endif diff --git a/Assets/VRM.Samples/Scripts/VRMRuntimeLoader.cs b/Assets/VRM.Samples/Scripts/VRMRuntimeLoader.cs index 3e4911286..95c4f0006 100644 --- a/Assets/VRM.Samples/Scripts/VRMRuntimeLoader.cs +++ b/Assets/VRM.Samples/Scripts/VRMRuntimeLoader.cs @@ -74,6 +74,8 @@ namespace VRM.Samples { #if UNITY_STANDALONE_WIN var path = FileDialogForWindows.FileDialog("open VRM", ".vrm"); +#elif UNITY_EDITOR + var path = UnityEditor.EditorUtility.OpenFilePanel("Open VRM", "", "vrm"); #else var path = Application.dataPath + "/default.vrm"; #endif @@ -115,6 +117,8 @@ namespace VRM.Samples { #if UNITY_STANDALONE_WIN var path = FileDialogForWindows.FileDialog("open VRM", ".vrm"); +#elif UNITY_EDITOR + var path = UnityEditor.EditorUtility.OpenFilePanel("Open VRM", "", "vrm"); #else var path = Application.dataPath + "/default.vrm"; #endif @@ -183,6 +187,12 @@ namespace VRM.Samples { LoadBvh(path); } +#elif UNITY_EDITOR + var path = UnityEditor.EditorUtility.OpenFilePanel("Open BVH", "", "bvh"); + if (!string.IsNullOrEmpty(path)) + { + LoadBvh(path); + } #else LoadBvh(Application.dataPath + "/default.bvh"); #endif diff --git a/Assets/VRM.Samples/Scripts/ViewerUI.cs b/Assets/VRM.Samples/Scripts/ViewerUI.cs index b97a26f22..a754a720b 100644 --- a/Assets/VRM.Samples/Scripts/ViewerUI.cs +++ b/Assets/VRM.Samples/Scripts/ViewerUI.cs @@ -259,6 +259,8 @@ namespace VRM.Samples { #if UNITY_STANDALONE_WIN var path = FileDialogForWindows.FileDialog("open VRM", "vrm", "glb", "bvh"); +#elif UNITY_EDITOR + var path = UnityEditor.EditorUtility.OpenFilePanel("Open VRM", "", "vrm"); #else var path = Application.dataPath + "/default.vrm"; #endif