Picking a folder from File Explorer...
One question. I have an InputField and a button. I'd like the button to start up the File Explorer so I can choose a folder. From there, once I clicked "Choose folder", I can have the directory of the folder I just picked stored in the InputField.
I click the button, the file explorer starts up.
I navigate to the folder I want and click on "Choose folder" from the file explorer.
File explorer closes and the directory from where I picked the folder shows up as text in the InputField example) InputField shows "D:\Unity\Projects\multiplayertest\folder\"
Anyone?
If so, much appreciated! Thanks.
Answer by LlamaTheHutt · Oct 06, 2019 at 10:59 PM
I'm not trying hard enough apparently... no need guys! I got it!
string directory = EditorUtility.OpenFolderPanel("Select Directory", "", "");
This prompts me again to choose a folder once I've chosen it already but whatever.
MISSION COMPLETE.
Answer by LlamaTheHutt · Oct 06, 2019 at 10:49 PM
Step 1: I've created the function for the button to open the File Explorer and select a folder with the following function:
public void FileExplorerTest()
{
EditorUtility.OpenFolderPanel("Select Directory", "", "");
}
So that's that. Now all I need to do is place the user's selected directory into an InputField.
directory = text;
Something like that!