Version: 5.4
public static string OpenFolderPanel (string title, string folder, string defaultName);

説明

"open folder"ダイアログを表示し、選択されたパスを取得します

関連項目: OpenFilePanelSaveFolderPanel 関数


Open Folder Panel.

using UnityEditor;
using System.IO;

public class OpenFolderPanelExample : EditorWindow { [MenuItem( "Example/Load Textures To Folder" )] static void Apply( ) { string path = EditorUtility.OpenFolderPanel( "Load png Textures", "", "" ); string[] files = Directory.GetFiles( path );

foreach( string file in files ) if( file.EndsWith( ".png" ) ) File.Copy( file, EditorApplication.currentScene ); }

}
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961