A utility package to use file browser related things in unity runtime
- File picker(utilizes rfd)
- Single file
- Multiple files
- Single directory
- Multiple directories
- Reveal a path(utilizes opener)
- use openupm
- Run command:
openupm add com.7thbeat.filebrowser
- Run command:
- use git url to install(use latest commit)
Window
->Package Manager
in unity editor- click
+
button, Add package from Git URL - Enter
git+https://github.com/7thbeatgames/UnityFileBrowser.git?path=Packages/com.7thbeat.filebrowser
see the description of each method for more details
Basic file picker
var path = FileBrowser.PickFile(
directory: Application.persistentDataPath,
filterName: "Log file",
filterExtensions: new[] { "log" },
title: "Select a log file"
);
Basic save file picker
var path = FileBrowser.SaveFile(
directory: Application.persistentDataPath,
filename: "hello.log",
filterName: "Log file",
filterExtensions: new[] { "log" },
title: "save file!"
);
FileDialog example(Advanced)
using var dialog = new FileDialog();
dialog.SetTitle("Example dialog!");
dialog.SetDirectory(Application.persistentDataPath);
dialog.AddFilter("Text file", new[] { "txt" });
dialog.AddFilter("JSON file", new[] { "json" }); // you can add multiple filters!
var path = dialog.PickFile();