Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

UniFileBrowser - runtime file browsing

Discussion in 'Assets and Asset Store' started by Eric5h5, May 4, 2013.

  1. FFozzy

    FFozzy

    Joined:
    Oct 22, 2015
    Posts:
    4
    Huh. We just tried it again, adding the reference for Boo.Lang to all 3 Assembly Reference spots in the Mono solution, and it did not remove the error. We are using Unity 5.4.3f1, on both OSX and Windows. As a side note, we tried it on 2 separate Macs.

    edit for clarity: On Windows I don't see this error, and am using Visual Studio. On the 2 Macs, they are using Mono, and both see this error.

    To add the references, we opened the solution tab in Mono, and for each Assembly-Reference (Assembly-CSharp, Assembly-CSharp-Editor, Assembly-CSharp-Firstpass), we clicked Edit References and checked "Boo.Lang" in the list. We are using the UniFileBrowser.dll. I also made a branch for us to try on the Macs, which uses the JS file instead, but that didn't appear to make a difference.

    Does this match the steps you took to resolve the issue on your machine?

    We also tried checking the x86, x86_64 boxes under Windows and Mac for Platform Settings in Unity itself, although Any Platform was already checked.
     
    Last edited: Mar 24, 2017
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Oh, in that case there's no JS involved, no error, and no need to add any references. I was using the source code. (But in that case, yes, those are the steps I used, but like I said with the DLL there's no error in the first place, or at least not any caused by UniFileBrowser.)

    --Eric
     
  3. FFozzy

    FFozzy

    Joined:
    Oct 22, 2015
    Posts:
    4
    Thanks for the solution, Eric!
    As you mentioned via IM, I copied the Unity/Editor/Data/mono/lib/mono/2.0/Boo.Lang.dll into my project's Assets/Plugins directory, re-synced the project in Mono, and then it worked just fine in the editor on OSX.
     
  4. WalterEspinar

    WalterEspinar

    Joined:
    Aug 23, 2011
    Posts:
    83
    Hi Eric, can't select folders, when i try click on folder nothing happen
    UnityFileBrowser.gif.gif
     
  5. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Yes, that's an issue with Unity 2017.3; I'll have an update soon.

    --Eric
     
  6. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,628
    Is the old gui being deprecated in unity? I noticed it says the gui component is deprecated in 2017.3p3

    Forgot the exact name of the component. It's the required component for using the old gui System
     
  7. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    UniFileBrowser does not use GUI components (GUIText/GUITexture) and never has.

    --Eric
     
  8. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    OK, updated.

    UniFileBrowser 2.7

    Changes:
    • Popup folder list behavior is now click then click to select, instead of drag and release.
    • Inspector GUI organized better, with tooltips for the variables.
    • Requires Unity 4.6 or later.

    Fixes:
    • Popup folder list works with later versions of Unity 2017.

    --Eric
     
  9. Geoff_001_01

    Geoff_001_01

    Joined:
    Oct 18, 2017
    Posts:
    4
    Hello Everyone:

    I just purchased UniFileBrowser yesterday. How do you get the full path name
    of an asset. For example, if I select image.jpg how do I get the full path?
    C:\TempFolder\image.jpg

    Thank you,

    Tom
     
  10. Geoff_001_01

    Geoff_001_01

    Joined:
    Oct 18, 2017
    Posts:
    4
    Hello Everyone:

    I found out how to find the path.
    Use: pathToFile (which is a string)
    instead of fileName.

    Thank you,

    Tom
     
  11. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Yes, you always get the full path. You can extract just the file name if you want.

    --Eric
     
  12. Polysquat_Studios

    Polysquat_Studios

    Joined:
    Nov 6, 2014
    Posts:
    37
    Hi, is there a way to get the file path of a file that is highlighted in the browser. I am trying to make a simple thumbnail viewer with a custom function.
     
  13. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Not out of the box, but if you modified the source to have a function that had this code:

    Code (csharp):
    1. if (selectedFileNumber > dirList.Count) {
    2.     return filePath + fileName;
    3. }
    that should do it.

    --Eric
     
  14. Polysquat_Studios

    Polysquat_Studios

    Joined:
    Nov 6, 2014
    Posts:
    37
    Thanks, I managed to get it working.
     
  15. Polysquat_Studios

    Polysquat_Studios

    Joined:
    Nov 6, 2014
    Posts:
    37
    How would I change the distance between the Popup Rect and the listScrollview panel? I'd like to move the scrollbar panel down from the Popup Rect.
     
  16. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    In the UpdateRects function, for the second line you could add something like:

    Code (csharp):
    1. fileBoxRect.y += 10; // or however many pixels you want
    --Eric
     
  17. Polysquat_Studios

    Polysquat_Studios

    Joined:
    Nov 6, 2014
    Posts:
    37
    Hi Again, How could I Set the Path after UniFileBrowser has loaded. Im trying to create a button to go to the desktop. I can initialize the folder with UniFileBrowser.use.SetPath (Environment.GetFolderPath(Environment.SpecialFolder.Desktop)); But once that is in a custom function it loads and a StartIndex error occurs.
     
  18. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    You can use CloseFileWindow, SetPath, then OpenFileWindow.

    --Eric
     
  19. ArtPose

    ArtPose

    Joined:
    Jun 13, 2014
    Posts:
    3
    Your plugin works great across all the platforms i am using it on (iOS, Android, mac and pc. My issue is on mobile it has a hard code number to set for distance of where the dialog shows up. This is a real issue for me on mobile. The iOS devices and android have many resolutions. I need to center the dialog. I noticed the warning dialog is set to always center but i see no way to make the larger dialog set to always center. I cant check for every type of resolution and device. I use NGUI to handle these transformations automatically. your dialog seems to be set up on the old style of doing interface. Is there anyway to make the main dialog open centered? I am not a coder I use playmaker visual scripting for all my coding needs. Love the plugin but this is a nagging issue for me since i cant have the dialog auto resize for different resolutions.
     
  20. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    You can use the SetFileWindowPosition/SetFileWindowSize functions, in combination with Screen.width/height, to center the window by using some calculations. This does require a little coding.

    --Eric
     
  21. Geoff_001_01

    Geoff_001_01

    Joined:
    Oct 18, 2017
    Posts:
    4
    Hello Everyone:

    Is there a way to make unifilebrowser model so
    I cannot select something else with the mouse and
    model would lock user interaction to the browser
    (until closed).

    Thank you,

    Geoff
     
  22. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Write some code so that if you've called OpenFileWindow or SaveFileWindow, prevent other actions from doing anything. It's not something UniFileBrowser would do by itself.

    --Eric
     
  23. Tomr001

    Tomr001

    Joined:
    Sep 7, 2018
    Posts:
    3
  24. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    If that asset has its own file browser/loader, I expect you wouldn't be able to use UniFileBrowser with it. I don't have it, though, so I'm not 100% sure.

    --Eric
     
  25. Tomr001

    Tomr001

    Joined:
    Sep 7, 2018
    Posts:
    3
    To Whom It May Concern:

    I have the filter set to .fbx and .obj and UniFileBrowser does not
    show some of my fbx files when I use OpenFileWindow(OpenFile).
    It does show some .fbx files but not all. Is there a solution to this
    problem.

    Thank you,

    Geoff
     
  26. Tomr001

    Tomr001

    Joined:
    Sep 7, 2018
    Posts:
    3
    To Whom It May Concern:

    I found out that .fbx is case sensitive. Is there a way to
    turn this on or off as needed?

    Thank you,

    Geoff
     
  27. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Not out of the box, but you could modify the source code to do it.

    --Eric
     
  28. KAYUMIY

    KAYUMIY

    Joined:
    Nov 12, 2015
    Posts:
    115
    Dear Sir

    I am going to buy your asset, but I have to be sure that it is possible to save data into any folder in PC by using your asset.
    As you know
    https://docs.unity3d.com/ScriptReference/Application-dataPath.html
    By using Application.data, we can save the data into existing file which is created by programmer before program runs.
    But, I want to give a choice to end-user may create a new file and save data into the file in PC after unity app runs.
     
  29. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Yes, you can select any folder. Thank you for your interest!

    --Eric
     
  30. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,628
    @Eric5h5

    I really having a hard time customizing appearance. the transparency is to light on the back ground and the buttons for cancel and open.

    I darken the UFBwindow texture pretty dark but didnt make much of a difference. what texture is used for the buttons?

     
  31. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    You can change the GUI skin with appropriate textures; transparency is controlled by alpha and not how dark the color is:

    Screen Shot 2019-11-22 at 1.03.02 PM.png

    --Eric
     
  32. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,628
    Alright thanks Eric. I thought I clicked on everything guess I missed something.
     
  33. Sudarmin-Then

    Sudarmin-Then

    Joined:
    Nov 27, 2014
    Posts:
    27
    Got an error on Unity 2021.1.5f1 : "Unloading broken assembly Assets/UniFileBrowser/Plugins/UniFileBrowser.dll, this assembly can cause crashes in the runtime"
    WIll you update the .dll so it is compatible with the new version of Unity?
     
    Last edited: Apr 29, 2021
  34. Jonatan_the_Game_Developer

    Jonatan_the_Game_Developer

    Joined:
    Dec 6, 2021
    Posts:
    1
    Having the same issue
     
  35. Vitta_

    Vitta_

    Joined:
    Jun 13, 2023
    Posts:
    1
    @Eric5h5 Does/will this asset work with newer versions of Unity? These two most recent posts indicate it isn't compatible, so I am hesitant to purchase.
     
    Last edited: Aug 1, 2023
  36. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    No, it only works with older versions, sorry.

    --Eric
     
  37. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    1,873
    Hi, Eric. For Unity 2022+, would you recommend any alternative assets in particular for this?

    I have some old code I could dust off and turn into a skinnable, UIToolkit/UI-2022 compatible build, but ... I'm guessing you (or someone you know) has already done that?
     
  38. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Sorry, but I'm not familiar with other assets.

    --Eric