Skip to content

7thbeatgames/UnityFileBrowser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unity File Browser

openupm

A utility package to use file browser related things in unity runtime

Features

  • File picker(utilizes rfd)
    • Single file
    • Multiple files
    • Single directory
    • Multiple directories
  • Reveal a path(utilizes opener)

Installation

  1. use openupm
    • Run command: openupm add com.7thbeat.filebrowser
  2. 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

Examples

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();

About

A simple file browser utility package for Unity

Resources

License

Stars

Watchers

Forks

Packages

No packages published