Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
U

UnitySimpleFileBrowser

> 编程语言
Open source

A uGUI based runtime file browser for Unity 3D (draggable and resizable)

989 stars0 likes1 views
WebsiteGitHub

About

A uGUI based runtime file browser for Unity 3D (draggable and resizable)

Unity Simple File Browser

Available on Asset Store: https://assetstore.unity.com/packages/tools/gui/runtime-file-browser-113006

Forum Thread: https://forum.unity.com/threads/simple-file-browser-open-source.441908/

Discord: https://discord.gg/UJJt549AaV

GitHub Sponsors ☕

FEATURES

  • Behaves similar to Windows file chooser
  • Ability to search by name or filter by type
  • Quick links
  • Simple user interface
  • Draggable and resizable
  • Ability to choose folders instead of files
  • Supports selecting multiple files/folders
  • Can easily be reskinned
  • Supports runtime permissions on Android M+ and Storage Access Framework on Android Q+
  • Optimized using a recycled list view (makes Instantiate calls sparingly)

NOTE: Universal Windows Platform (UWP) and WebGL platforms aren't supported!

INSTALLATION

There are 5 ways to install this plugin:

  • import SimpleFileBrowser.unitypackage via Assets-Import Package
  • clone/download this repository and move the Plugins folder to your Unity project's Assets folder
  • import it from Asset Store
  • (via Package Manager) click the + button and install the package from the following git URL:
    • https://github.com/yasirkula/UnitySimpleFileBrowser.git
  • (via OpenUPM) after installing openupm-cli, run the following command:
    • openupm add com.yasirkula.simplefilebrowser

FAQ

  • File browser doesn't show any files on Mac when sandboxing is enabled

This is a known issue but I can't give an ETA for a solution at the moment: https://github.com/yasirkula/UnitySimpleFileBrowser/issues/66

  • File browser doesn't show any files on Android 10+

File browser uses Storage Access Framework on these Android versions and users must first click the Browse... button in the quick links section.

  • File browser doesn't show any files on Oculus Quest

Please see: https://github.com/yasirkula/UnitySimpleFileBrowser/issues/87 and https://github.com/yasirkula/UnitySimpleFileBrowser/issues/89

  • File browser doesn't show any files on Unity 2021.3.x

Please see: https://github.com/yasirkula/UnitySimpleFileBrowser/issues/70

  • New Input System isn't supported on Unity 2019.2.5 or earlier

Add ENABLE_INPUT_SYSTEM compiler directive to Player Settings/Scripting Define Symbols (these symbols are platform specific, so if you change the active platform later, you'll have to add the compiler directive again).

  • "Unity.InputSystem" assembly can't be resolved on Unity 2018.4 or earlier

Remove Unity.InputSystem assembly from SimpleFileBrowser.Runtime Assembly Definition File's Assembly Definition References list.

  • Android build fails, it says "error: attribute android:requestLegacyExternalStorage not found" in Console

android:requestLegacyExternalStorage attribute in AndroidManifest.xml grants full access to device's storage on Android 10 but requires you to update your Android SDK to at least SDK 29. If this isn't possible for you, you should open SimpleFileBrowser.aar with WinRAR or 7-Zip and then remove the `` tag from AndroidManifest.xml.

  • Android build fails with error message "D8: java.lang.NullPointerException Failed to transform SimpleFileBrowser-.aar"

The plugin is using "Gradle version" 7.5.1 and "Android Gradle plug-in version" 7.4.2. Make sure your Unity version is compatible: https://docs.unity3d.com/2021.3/Documentation/Manual/android-gradle-overview.html

  • Can't show the file browser on Android, it says "java.lang.ClassNotFoundException: com.yasirkula.unity.FileBrowserPermissionReceiver" in Logcat

If you are sure that your plugin is up-to-date, then enable Custom Proguard File option from Player Settings and add the following line to that file: -keep class com.yasirkula.unity.* { *; }

  • RequestPermission returns Permission.Denied on Android

Declare the WRITE_EXTERNAL_STORAGE permission manually in your Plugins/Android/AndroidManifest.xml file with the tools:node="replace" attribute as follows: (you'll need to add the `xmlns:tools="http://schemas.android.com/tools"` attribute to the element).

HOW TO

NOTE: On Android Q (10) or later, it is impossible to work with File APIs. On these devices, SimpleFileBrowser uses Storage Access Framework (SAF) to browse the files. However, paths returned by SAF are not File API compatible. To simulate the behaviour of the File API on all devices (including SAF), you can check out the FileBrowserHelpers functions. For reference, here is an example SAF path: content://com.android.externalstorage.documents/tree/primary%3A/document/primary%3APictures

First, add using SimpleFileBrowser; to your script.

The file browser can be shown either as a save dialog or a load dialog. In load mode, the returned path(s) always lead to existing files or folders. In save mode, the returned path(s) can point to non-existing files, as well. You can use the following functions to show the file browser:

csharp
public static bool ShowSaveDialog( OnSuccess onSuccess, OnCancel onCancel, PickMode pickMode, bool allowMultiSelection = false, string initialPath = null, string initialFilename = null, string title = "Save", string saveButtonText = "Save" );
public static bool ShowLoadDialog( OnSuccess onSuccess, OnCancel onCancel, PickMode pickMode, bool allowMultiSelection = false, string initialPath = null, string initialFilename = null, string title = "Load", string loadButtonText = "Select" );

public delegate void OnSuccess( string[] paths );
public delegate void OnCancel();

There can only be one dialog active at a time. These functions will return true if the dialog is shown successfully (if no other dialog is active), false otherwise. You can query the FileBrowser.IsOpen property to see if there is an active dialog at the moment.

If user presses the Cancel button, onCancel callback is called. Otherwise, onSuccess callback is called with the paths of the selected files/folders as parameter. pickMode can be Files, Folders or FilesAndFolders. Setting allowMultiSelection to true will allow picking multiple files/folders.

There are also coroutine variants of these functions that will yield while the dialog is active:

csharp
public static IEnumerator WaitForSaveDialog( PickMode pickMode, bool allowMultiSelection = false, string initialPath = null, string initialFilename = null, string title = "Save", string saveButtonText = "Save" );									 
public static IEnumerator WaitForLoadDialog( PickMode pickMode, bool allowMultiSelection = false, string initialPath = null, string initialFilename = null, string title = "Load", string loadButtonText = "Select" );

After the dialog is closed, you can check the FileBrowser.Success property to see whether the user has selected some files/folders or cancelled the operation and if FileBrowser.Success is set to true, you can use the FileBrowser.Result property to get the paths of the selected files/folders.

You can force close an open dialog using the following function:

csharp
public static void HideDialog( bool invokeCancelCallback = false );

If there is an open dialog and the invokeCancelCallback parameter is set to true, the onCancel callback of the dialog will be invoked. This function can also be used to initialize the file browser ahead of time, which in turn will reduce the lag when you first open a dialog.

To add a quick link to the browser, you can use the following function (to clear all quick links, use ClearQuickLinks()):

csharp
public static bool AddQuickLink( string name, string path, Sprite icon = null );

When icon parameter is left as null, the quick link will have a folder icon.

By default, the file browser doesn't show files with .lnk or .tmp extensions. You can extend this list or remove this restriction altogether using the following function:

csharp
public static void SetExcludedExtensions( params string[] excludedExtensions );

Lastly, you can use the following functions to set the file filters (filters should include the period, e.g. ".jpg" instead of "jpg"):

csharp
public static void SetFilters( bool showAllFilesFilter, IEnumerable filters );
public static void SetFilters( bool showAllFilesFilter, params string[] filters );
public static void SetFilters( bool showAllFilesFilter, IEnumerable filters );
public static void SetFilters( bool showAllFilesFilter, params FileBrowser.Filter[] filters );

When showAllFilesFilter is set to true, a filter by the name "All Files (.*)" will appear that will show all the files when selected. To select a default filter, use the following function:

csharp
public static bool SetDefaultFilter( string defaultFilter );

You can programmatically filter the files/folders displayed in the file browser via the DisplayedEntriesFilter event:

csharp
FileBrowser.DisplayedEntriesFilter += ( entry ) =>
{
	if( !entry.IsDirectory )
		return true; // Don't filter files

	return entry.Name.StartsWith( "Save" ); // Show only the directories whose name start with "Save"
};

You can override the search behaviour (e.g. use regex) via the CustomSearchHandler event:

csharp
FileBrowser.CustomSearchHandler += (entry, searchTerm) =>
{
    return entry.Name.Contains(searchTerm);
};

You can set whether or not hidden files should be shown in the file browser via FileBrowser.ShowHiddenFiles (has no effect when Storage Access Framework is used on Android 10+). This value can also be changed from the "Show hidden files" toggle in the user interface. To change the visibility of that toggle, you can use FileBrowser.DisplayHiddenFilesToggle. Note that this toggle is always hidden on Android 10+ when Storage Access Framework is used or on mobile devices when device is held in portrait orientation.

To open files or directories in the file browser with a single click (instead of double clicking), you can set FileBrowser.SingleClickMode to true.

File browser refreshes the list of drives at a regular interval to detect the insertion/removal of USB drives. This interval can be changed via FileBrowser.DrivesRefreshInterval. If its value is less than 0, list of drives won't be refreshed. By default, this value is 5 seconds on standalone platforms and -1 on mobile platforms.

In file saving mode, if the user selects one or more existing files, the file browser will show a file overwrite dialog. To disable this behaviour, you can set FileBrowser.ShowFileOverwriteDialog to false.

While saving files/folders or loading folders, file browser can check if the user has write access to the destination folder(s) to ensure that any file operations inside those folder(s) will work without any issues. To do that, file browser attempts to create dummy files inside those folder(s) and if it fails, an error dialog is displayed to the user. This feature is disabled by default because some folders may have write access but not delete access, in which case the created dummy file will remain in the destination folder(s). To enable this feature, you can set FileBrowser.CheckWriteAccessToDestinationDirectory to true.

File browser comes bundled with two premade skins in the Skins directory: LightSkin and DarkSkin. New UISkins can be created via Assets-Create-yasirkula-SimpleFileBrowser-UI Skin. A UISkin can be assigned to the file browser in two ways:

  • By changing SimpleFileBrowserCanvas prefab's Skin field
  • By changing th

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C#

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言