###↓こんな感じのダイアログボックスを使ってファイルを選択したい
追記
※ビルド後にこのダイアログボックスを使用することはできないらしい
ビルド後に使うならOpenFileDialogを使うのが正解
こことかここの記事が使えそう
#Script
script
using UnityEditor;
public void OpenFile()
{
//パスの取得
var path = EditorUtility.OpenFilePanel("Open csv", "", "CSV");
if (string.IsNullOrEmpty(path))
return;
Debug.Log(path);
//読み込み
var reader = new StreamReader(path);
Debug.Log(reader);
}
#詳細 //ここでダイアログボックスを出す
##1つのファイルを選択
script
var path = EditorUtility.OpenFilePanel("Open csv", "", "CSV");
var path = EditorUtility.OpenFilePanel(ダイアログボックスの名前, ディレクトリのデフォルト設定,読み込むファイルの拡張子 );
##複数種類のファイル拡張子を指定する場合
script
var path = EditorUtility.OpenFilePanelWithFilters("Open Music", "", {"音楽ファイル","mp3,ogg,wav"});
EditorUtility.OpenFilePanelWithFilters
##フォルダーを選択する場合
script
var path = EditorUtility.OpenFolderPanel("Open Folder", "", "");