messageTarget and messageName

This commit is contained in:
ousttrue
2025-04-08 17:10:15 +09:00
parent d5833cff81
commit 0190bf9825

View File

@@ -139,7 +139,7 @@ namespace UniVRM10.VRM10Viewer
[DllImport("__Internal")]
public static extern void WebGL_VRM10_VRM10Viewer_FileDialog(string target, string message);
string FileDialog(string callbackObject, string callbackMethod)
string FileDialog(string messageTarget, string messageName)
{
#if UNITY_EDITOR
return UnityEditor.EditorUtility.OpenFilePanel("Open VRM", "", "vrm,glb,gltf,zip");
@@ -148,7 +148,7 @@ namespace UniVRM10.VRM10Viewer
#elif UNITY_WEBGL
// Open WebGL_VRM10_VRM10Viewer_FileDialog
// see: Assets\VRM10_Samples\VRM10Viewer\Plugins\WebGL_VRM10_VRM10Viewer.jslib
WebGL_VRM10_VRM10Viewer_FileDialog(callbackObject, callbackMethod);
WebGL_VRM10_VRM10Viewer_FileDialog(messageTarget, messageName);
// Control flow does not return here. return empty string with dummy
return null;
#else
@@ -163,9 +163,9 @@ namespace UniVRM10.VRM10Viewer
var _ = LoadModelBytes("WebGL.vrm", www.downloadHandler.data, opts);
}
public void OnOpenModelClicked(LoadOptions opts, string callbackObject, string callbackMethod)
public void OnOpenModelClicked(LoadOptions opts, string messageTarget, string messageName)
{
var path = FileDialog(callbackObject, callbackMethod);
var path = FileDialog(messageTarget, messageName);
_ = LoadModelPath(path, opts);
}