Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@bibinba
Created December 2, 2018 11:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bibinba/e72660c7c45e315f48715309bf84e639 to your computer and use it in GitHub Desktop.
Save bibinba/e72660c7c45e315f48715309bf84e639 to your computer and use it in GitHub Desktop.
VRMを選択してインポートする
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
using System.Windows.Forms;
public class vrmimport : MonoBehaviour
{
public void onFileOpen()
{
OpenFileDialog ofDialog = new OpenFileDialog();
// デフォルトのフォルダを指定する
//ofDialog.InitialDirectory = @"A:";
ofDialog.FileName = "A:";
//csvファイルを開くことを指定する
ofDialog.Filter = "vrmファイル|*.vrm";
//ダイアログのタイトルを指定する
ofDialog.Title = "VRMファイルを開け!!!!!";
//ダイアログを表示する
if (ofDialog.ShowDialog() == DialogResult.OK)
{
// Console.WriteLine(ofDialog.FileName);
var path = ofDialog.FileName;
VRM.VRMImporter.LoadVrmAsync(path, go => {
Debug.LogFormat("loaded {0}", go.name);
});
}
else
{
Console.WriteLine("キャンセルされました");
}
// オブジェクトを破棄する
ofDialog.Dispose();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment