mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-04-21 14:37:49 -05:00
WebGLFileDialog to UniVRM_Sample_WebGLFileDialog
This commit is contained in:
parent
dc3d406757
commit
e48867cfea
8
Assets/UniGLTF/Editor/Plugins.meta
Normal file
8
Assets/UniGLTF/Editor/Plugins.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a75c9f76297d99041bdf9ca2458d12bb
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
mergeInto(LibraryManager.library, {
|
||||
WebGLFileDialog: function (_target, _message) {
|
||||
UniVRM_Sample_WebGLFileDialog: function (_target, _message) {
|
||||
const target = UTF8ToString(_target);
|
||||
const message = UTF8ToString(_message);
|
||||
const file_input_id = "file-input";
|
||||
|
|
@ -20,4 +20,4 @@ mergeInto(LibraryManager.library, {
|
|||
}
|
||||
file_input.click();
|
||||
},
|
||||
});
|
||||
});
|
||||
|
|
@ -7,9 +7,9 @@ namespace VRM.SimpleViewer
|
|||
#if UNITY_STANDALONE_WIN
|
||||
return FileDialogForWindows.FileDialog(title, extensions);
|
||||
#elif UNITY_WEBGL
|
||||
// Open WebGLFileDialog
|
||||
// Open UniVRM_Sample_WebGLFileDialog
|
||||
// see: Assets/UniGLTF/Runtime/Utils/Plugins/OpenFile.jslib
|
||||
WebGLUtil.WebGLFileDialog("Canvas", "FileSelected");
|
||||
WebGLUtil.UniVRM_Sample_WebGLFileDialog("Canvas", "FileSelected");
|
||||
// Control flow does not return here. return empty string with dummy
|
||||
return "";
|
||||
#elif UNITY_EDITOR
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ namespace VRM.SimpleViewer
|
|||
public static class WebGLUtil
|
||||
{
|
||||
[DllImport("__Internal")]
|
||||
public static extern void WebGLFileDialog(string target, string message);
|
||||
public static extern void UniVRM_Sample_WebGLFileDialog(string target, string message);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -641,16 +641,16 @@ namespace UniVRM10.VRM10Viewer
|
|||
}
|
||||
|
||||
[DllImport("__Internal")]
|
||||
public static extern void WebGLFileDialog(string target, string message);
|
||||
public static extern void UniVRM_Sample_WebGLFileDialog(string target, string message);
|
||||
|
||||
string FileDialog()
|
||||
{
|
||||
#if UNITY_STANDALONE_WIN
|
||||
return VRM10FileDialogForWindows.FileDialog("open VRM", "vrm");
|
||||
#elif UNITY_WEBGL
|
||||
// Open WebGLFileDialog
|
||||
// Open UniVRM_Sample_WebGLFileDialog
|
||||
// see: Assets/UniGLTF/Runtime/Utils/Plugins/OpenFile.jslib
|
||||
WebGLFileDialog("Canvas", "FileSelected");
|
||||
UniVRM_Sample_WebGLFileDialog("Canvas", "FileSelected");
|
||||
// Control flow does not return here. return empty string with dummy
|
||||
return null;
|
||||
#elif UNITY_EDITOR
|
||||
|
|
|
|||
|
|
@ -641,16 +641,16 @@ namespace UniVRM10.VRM10Viewer
|
|||
}
|
||||
|
||||
[DllImport("__Internal")]
|
||||
public static extern void WebGLFileDialog(string target, string message);
|
||||
public static extern void UniVRM_Sample_WebGLFileDialog(string target, string message);
|
||||
|
||||
string FileDialog()
|
||||
{
|
||||
#if UNITY_STANDALONE_WIN
|
||||
return VRM10FileDialogForWindows.FileDialog("open VRM", "vrm");
|
||||
#elif UNITY_WEBGL
|
||||
// Open WebGLFileDialog
|
||||
// Open UniVRM_Sample_WebGLFileDialog
|
||||
// see: Assets/UniGLTF/Runtime/Utils/Plugins/OpenFile.jslib
|
||||
WebGLFileDialog("Canvas", "FileSelected");
|
||||
UniVRM_Sample_WebGLFileDialog("Canvas", "FileSelected");
|
||||
// Control flow does not return here. return empty string with dummy
|
||||
return null;
|
||||
#elif UNITY_EDITOR
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@ namespace VRM.SimpleViewer
|
|||
#if UNITY_STANDALONE_WIN
|
||||
return FileDialogForWindows.FileDialog(title, extensions);
|
||||
#elif UNITY_WEBGL
|
||||
// Open WebGLFileDialog
|
||||
// Open UniVRM_Sample_WebGLFileDialog
|
||||
// see: Assets/UniGLTF/Runtime/Utils/Plugins/OpenFile.jslib
|
||||
WebGLUtil.WebGLFileDialog("Canvas", "FileSelected");
|
||||
WebGLUtil.UniVRM_Sample_WebGLFileDialog("Canvas", "FileSelected");
|
||||
// Control flow does not return here. return empty string with dummy
|
||||
return "";
|
||||
#elif UNITY_EDITOR
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ namespace VRM.SimpleViewer
|
|||
public static class WebGLUtil
|
||||
{
|
||||
[DllImport("__Internal")]
|
||||
public static extern void WebGLFileDialog(string target, string message);
|
||||
public static extern void UniVRM_Sample_WebGLFileDialog(string target, string message);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user