OpenFolderPanel









How do I use Open Folder Panel
Below are practical examples compiled from projects for learning and reference purposes

Featured Snippets


File name: PhotonConverter.cs Copy
120     public static void PickFolderAndConvertScripts()
121     {
122         string folderPath = EditorUtility.OpenFolderPanel("Pick source folder to convert", Directory.GetCurrentDirectory(), "");
123         if (string.IsNullOrEmpty(folderPath))
124         {
125             EditorUtility.DisplayDialog("Script Conversion", "No folder was selected. No files were changed. Please start over.", "Ok.");
126             return;
127         }
128
129         bool result = EditorUtility.DisplayDialog("Script Conversion", "Scripts in this folder will be modified:\n\n" + folderPath + "\n\nMake sure you have backups of these scripts.\nConversion is not guaranteed to work!", "Backup done. Go!", "Abort");
130         if (!result)
131         {
132             return;
133         }
134
135         List scripts = GetScriptsInFolder(folderPath);
136         ConvertScripts(scripts);
137
138         EditorUtility.DisplayDialog("Script Conversion", "Scripts are now converted to PUN.\n\nYou will need to update\n- scenes\n- components\n- prefabs and\n- add \"PhotonNetwork.ConnectWithDefaultSettings();\"", "Ok");
139     }

OpenFolderPanel 124 lượt xem

Gõ tìm kiếm nhanh...