Git Product home page Git Product logo

unitystandalonefilebrowser's Introduction

Unity Standalone File Browser

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.

Download Package

Example usage:

// Open file
var paths = StandaloneFileBrowser.OpenFilePanel("Open File", "", "", false);

// Open file async
StandaloneFileBrowser.OpenFilePanelAsync("Open File", "", "", false, (string[] paths) => {  });

// Open file with filter
var extensions = new [] {
    new ExtensionFilter("Image Files", "png", "jpg", "jpeg" ),
    new ExtensionFilter("Sound Files", "mp3", "wav" ),
    new ExtensionFilter("All Files", "*" ),
};
var paths = StandaloneFileBrowser.OpenFilePanel("Open File", "", extensions, true);

// Save file
var path = StandaloneFileBrowser.SaveFilePanel("Save File", "", "", "");

// Save file async
StandaloneFileBrowser.SaveFilePanelAsync("Save File", "", "", "", (string path) => {  });

// Save file with filter
var extensionList = new [] {
    new ExtensionFilter("Binary", "bin"),
    new ExtensionFilter("Text", "txt"),
};
var path = StandaloneFileBrowser.SaveFilePanel("Save File", "", "MySaveFile", extensionList);

See Sample/BasicSampleScene.unity for more detailed examples.

Mac Screenshot Alt text

Windows Screenshot Alt text

Linux Screenshot Alt text

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;

    Alt text Alt text

  • 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/

unitystandalonefilebrowser's People

Contributors

gkngkc avatar gokhangokce-infosfer avatar ricardoeprodrigues avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.