Created
December 2, 2018 11:04
-
-
Save bibinba/e72660c7c45e315f48715309bf84e639 to your computer and use it in GitHub Desktop.
VRMを選択してインポートする
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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