A simple wrapper for native file dialogs on Windows/Mac/Linux.
- Works in editor and runtime.
- Open file/folder, save file dialogs supported.
- Multiple file selection.
- File extension filter.
- Mono/IL2CPP backends supported.
- Linux support by Ricardo Rodrigues.
- Basic WebGL support.
Example usage:
// Open filevarpaths=StandaloneFileBrowser.OpenFilePanel("Open File","","",false);// Open file asyncStandaloneFileBrowser.OpenFilePanelAsync("Open File","","",false,(string[]paths)=>{});// Open file with filtervarextensions=new[]{newExtensionFilter("Image Files","png","jpg","jpeg"),newExtensionFilter("Sound Files","mp3","wav"),newExtensionFilter("All Files","*"),};varpaths=StandaloneFileBrowser.OpenFilePanel("Open File","",extensions,true);// Save filevarpath=StandaloneFileBrowser.SaveFilePanel("Save File","","","");// Save file asyncStandaloneFileBrowser.SaveFilePanelAsync("Save File","","","",(stringpath)=>{});// Save file with filtervarextensionList=new[]{newExtensionFilter("Binary","bin"),newExtensionFilter("Text","txt"),};varpath=StandaloneFileBrowser.SaveFilePanel("Save File","","MySaveFile",extensionList);See Sample/BasicSampleScene.unity for more detailed examples.
Notes:
Windows
- Requires .NET 2.0 api compatibility level
- Async dialog opening not implemented, ..Async methods simply calls regular sync methods.
- Plugin import settings should be like this;
Mac
- Sync calls are throws an exception at development build after native panel loses and gains focus. Use async calls to avoid this.
WebGL:
- Basic upload/download file support.
- File filter support.
- Not well tested, probably not much reliable.
- Since browsers require more work to do file operations, webgl isn't directly implemented to Open/Save calls. You can check CanvasSampleScene.unity and canvas sample scripts for example usages.
Live Demo: https://gkngkc.github.io/




