Search Unity

Open windows file explorer

Discussion in 'Scripting' started by jjuam, Dec 3, 2015.

  1. jjuam

    jjuam

    Joined:
    Jun 12, 2015
    Posts:
    51
    Hi everyone,

    I´m wondering how can I open a windows file explorer in my unity game. I have seen several assets to create a file browser in Unity, but I prefer that my game open a regular windows file explorer (if is posible for Mac too ;))
    Thanks a lot in advance!!
     
  2. RiokuTheSlayer

    RiokuTheSlayer

    Joined:
    Aug 22, 2013
    Posts:
    356
    https://msdn.microsoft.com/en-us/library/aa984392(v=vs.71).aspx

    I've wanted to know how to do stuff like this as well.

    I don't know exactly how well this'll work but you're going to have to look into raw c# methods of doing this. Unity doesn't have a built-in method to do this in your game.

    In the editor, it does, though
     
  3. jjuam

    jjuam

    Joined:
    Jun 12, 2015
    Posts:
    51
    I´m using: System.Diagnostics.Process.Start("explorer.exe","/select,"+path);
    On this way, it show a regular explorer window, but I want to be able to select (like in open option in any program) a specific file to open in my game.

    Thanks!!
     
  4. Munchy2007

    Munchy2007

    Joined:
    Jun 16, 2013
    Posts:
    1,735
  5. PygmyMonkey

    PygmyMonkey

    Joined:
    Jan 13, 2014
    Posts:
    306
    Hello,

    I made a Asset to use the Native File Browser from Windows and Mac in Unity at runtime, it's available on the Asset Store: https://www.assetstore.unity3d.com/en/#!/content/68064

    I've been searching for a way to do that for more than a year... and finally found how to do it :)
     
    Lohoris2 likes this.
  6. pumpedbarbarous

    pumpedbarbarous

    Joined:
    Mar 18, 2015
    Posts:
    16
  7. lupocupo

    lupocupo

    Joined:
    Sep 23, 2017
    Posts:
    3
    Once I have showed in a file browser a .png file with UnityStandaloneFileBrowser project, do you think is possible to open it with a specific app? My goal is to offer a way to find and print an image :)
     
  8. pumpedbarbarous

    pumpedbarbarous

    Joined:
    Mar 18, 2015
    Posts:
    16
    I don't think so. You decide via Windows what files are opened with what app, but I might be wrong.
     
  9. You can take a look at this for windows: https://assetstore.unity.com/packages/tools/integration/lcprinter-simple-texture-printer-67594 (I have no idea if it works or not, have no experience with it!)
    Theoretically you can call the standard printer libraries, but I have no idea if it's supported on any other platforms (and of course you will need to write platform-dependent code because Unity does not have platform-independent support for printers).
     
  10. Deleted User

    Deleted User

    Guest

    for some reason when i tried to open a compressed zip file, it only opens up file explorer. does anyone know the solution to this?