コード例 #1
0
    public void SaveFile()
    {
        string title = "请选择保存的位置:";
        string msg   = string.Empty;
        string path  = FileDialogForWindows.SaveDialog(title, Path.Combine(Application.streamingAssetsPath, "你要保存的文件名称.RAR"));//假如你存rar文件。

        if (!string.IsNullOrEmpty(path))
        {
            msg = "保存文件的路径为: " + path;
        }
        else
        {
            msg = "用户取消保存!";
        }
        text.text = msg;
    }
コード例 #2
0
    void OnExportClicked()
    {
//#if UNITY_STANDALONE_WIN
#if false
        var path = FileDialogForWindows.SaveDialog("save VRM", Application.dataPath + "/export.vrm");
#else
        var path = Application.dataPath + "/../export.vrm";
#endif
        if (string.IsNullOrEmpty(path))
        {
            return;
        }

        var vrm   = VRMExporter.Export(m_model);
        var bytes = vrm.ToGlbBytes();
        File.WriteAllBytes(path, bytes);
        Debug.LogFormat("export to {0}", path);
    }