Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  5. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    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:
    31,895
    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:
    76
    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:
    31,895
    Yes, that's an issue with Unity 2017.3; I'll have an update soon.

    --Eric
     
  6. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    965
    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:
    31,895
    UniFileBrowser does not use GUI components (GUIText/GUITexture) and never has.

    --Eric
     
  8. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    31,895
    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:
    3
    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:
    3
    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:
    31,895
    Yes, you always get the full path. You can extract just the file name if you want.

    --Eric
     
  12. therockswell

    therockswell

    Joined:
    Nov 6, 2014
    Posts:
    26
    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:
    31,895
    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. therockswell

    therockswell

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

    therockswell

    Joined:
    Nov 6, 2014
    Posts:
    26
    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:
    31,895
    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. therockswell

    therockswell

    Joined:
    Nov 6, 2014
    Posts:
    26
    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:
    31,895
    You can use CloseFileWindow, SetPath, then OpenFileWindow.

    --Eric
     
  19. ArtPose

    ArtPose

    Joined:
    Jun 13, 2014
    Posts:
    2
    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:
    31,895
    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:
    3
    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:
    31,895
    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:
    31,895
    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:
    31,895
    Not out of the box, but you could modify the source code to do it.

    --Eric