Search Unity

Loading resources via an 'open' dialog box???

Discussion in 'Editor & General Support' started by EnsurdFrndship, Apr 20, 2017.

  1. EnsurdFrndship

    EnsurdFrndship

    Joined:
    Apr 17, 2010
    Posts:
    786
    Hello,
    I already know that people can easily load resources from the resource folder, and also create asset bundles of files in folders, but what if during the game, I want to make a way to easily have a dialog box show up where I can open all the files in a folder that is on my hard drive, and access resources THAT way? Wouldn't that be a good idea (to where the user can open up a local folder)? Do they have this feature?

    Thanks,
    Michael S. Lowe
     
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,448
  3. EnsurdFrndship

    EnsurdFrndship

    Joined:
    Apr 17, 2010
    Posts:
    786
    Thank you. Since the examples use 'var' for their examples, is the 'paths' variable a string or an object? It would seem like if I wanted to open an entire folder, the return value of the function would need to be in the form of an array or a list. How would I access all the data I open from a folder? My goal is to take all the files in a folder, and store it into an array, instead of using Resource.LoadAll() from the Resource folder.
     
  4. EnsurdFrndship

    EnsurdFrndship

    Joined:
    Apr 17, 2010
    Posts:
    786
    Also, would I copy everything from the unzipped folder of my zip file (from UnityStandaloneFileBrowser) into the "Standard Assets" folder of my project?
     
  5. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,448
  6. EnsurdFrndship

    EnsurdFrndship

    Joined:
    Apr 17, 2010
    Posts:
    786
    Thank you, but 3 errors developed out of the package...

    Assets/StandaloneFileBrowser/StandaloneFileBrowserWindows.cs(5,14): error CS0234: The type or namespace name `Windows' does not exist in the namespace `System'. Are you missing an assembly reference?

    Assets/StandaloneFileBrowser/StandaloneFileBrowserWindows.cs(7,7): error CS0246: The type or namespace name `Ookii' could not be found. Are you missing an assembly reference?

    Assets/StandaloneFileBrowser/StandaloneFileBrowserWindows.cs(15,34): error CS0246: The type or namespace name `IWin32Window' could not be found. Are you missing an assembly reference?

    is there a way to download packages, have Unity 'detect' what files got added to where, what changes have been made to a project, and have that same package 'undo' and clean up everything?
     
  7. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,448
    check your player settings,
    • Windows version requires .NET 2.0 api compatibility level

    that package contained these files,
    upload_2017-4-21_17-43-23.png
     
  8. EnsurdFrndship

    EnsurdFrndship

    Joined:
    Apr 17, 2010
    Posts:
    786
    I downloaded it a third time, but am still receiving these same errors. I assume that the 'using Ookii.Dialogs' line is in reference to the Ookii.Dialogs.dll file, and the other 'using' lines that are giving me the other 2 errors are in reference to the .dll files, but maybe these .dll files were placed in the wrong directory somehow, and I don't know where to put them IF that is the case.
     
  9. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,448
    Are you on windows target platform?

    and did you set
    • Windows version requires .NET 2.0 api compatibility level
     
  10. EnsurdFrndship

    EnsurdFrndship

    Joined:
    Apr 17, 2010
    Posts:
    786
    I haven't yet learned how to do this.
     
  11. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,448
    in menu Edit/Project Settings/Player
    there is dropdown for API compatibility level

    upload_2017-4-26_15-39-50.png
     
  12. EnsurdFrndship

    EnsurdFrndship

    Joined:
    Apr 17, 2010
    Posts:
    786
    It didn't fix the problem. How would I get to window's target platform?
     
  13. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,448
    File / Build settings
    Select pc, click switch platform
    upload_2017-4-27_8-10-33.png

    Are you running unity on pc, mac or linux?
    • Linux is not supported.
     
  14. EnsurdFrndship

    EnsurdFrndship

    Joined:
    Apr 17, 2010
    Posts:
    786
    I am running a PC, and it turns out I am using the PC, Mac and Linux Standalone platform, and still got those errors.
     
  15. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,448
    works here either importing the package, or copying from the zip..

    can you screenshot your project window? (just to see all those files are there)
     
  16. EnsurdFrndship

    EnsurdFrndship

    Joined:
    Apr 17, 2010
    Posts:
    786
  17. EnsurdFrndship

    EnsurdFrndship

    Joined:
    Apr 17, 2010
    Posts:
    786
    I found out what the problem was. I had to upgrade Unity.
     
  18. baums

    baums

    Joined:
    Jun 18, 2019
    Posts:
    1
    Hello mgear!

    Any suggestions how to modify the location of the window when the dialog pops up?

    That would be of great help!

    Thank you!