Search Unity

Native File Browser (With Filter)

Discussion in 'Scripting' started by Prismatecs, May 21, 2016.

  1. Prismatecs

    Prismatecs

    Joined:
    May 20, 2016
    Posts:
    19
    Hello everyone,

    Is there any way to use platform native file browser with filter option within unity? I've found many custom scripts in the asset store but I want something more simple to work on PC,Android and iOS..

    Thank You,
     
  2. PygmyMonkey

    PygmyMonkey

    Joined:
    Jan 13, 2014
    Posts:
    306
    Prismatecs likes this.
  3. TDArlt

    TDArlt

    Joined:
    May 22, 2013
    Posts:
    23
    On windows, the fastest way is the assetstore.... or look for System.Windows.Forms in the C#-reference.

    File browsing on Android is quite hacky - running the native file browser should be done using an Intent. (Google "Intent", "Android" and "Unity"; I never used these in Unity, but I'm sure it shouldn't be too complicated; perhaps there is an asset in the asset store as well for doing Intents).

    However, on mobile devices, it's not recommended to let the user pick a file; usually it works the other way round: The file is given to the app and the app starts using it. Picking is not inteded and ugly to implement due to the restricted user rights.

    Worse on iOS: There is no file system you can access, so there's no native file browser you could launch.
     
    Prismatecs likes this.