EditorUtility.OpenFolderPanel

Unity3D 2013. 2. 14. 14:15
반응형


디렉터리를 선택하고 저장위치를 선택할때 사용.


http://docs.unity3d.com/Documentation/ScriptReference/EditorUtility.OpenFolderPanel.html


EditorUtility.OpenFolderPanel


static function OpenFolderPanel (title : String, folder : String, defaultName : String) : String

Description

Displays the "open folder" dialog and returns the selected path name.

See Also: OpenFilePanelSaveFolderPanel functions.


Open Folder Panel.

// Opens a directory dialog for copying all the png textures
// in the directory to where the current open scene resides

import System.IO;

@MenuItem("Examples/Load Textures to directory")
static function Apply () {

var path = EditorUtility.OpenFolderPanel("Load png Textures of Directory", "", "");
var files : String[] = Directory.GetFiles(path);
for(var file : String in files)
if(file.EndsWith(".png"))
File.Copy(file, EditorApplication.currentScene);
}

반응형
: