Comments (15)
You can call ShowLoadDialog after activating your own Canvas GameObject. Calling ShowLoadDialog is inevitable. This working fine on Windows must be a minor bug.
from unitysimplefilebrowser.
As shown in the attached, I customized the prefab for some specific functionality and use it as a GameObject window that I SetActive when the window is required. I do not have to run ShowLoadDialog explicitly on windows to give me the file listings. When I try to run it the same way on Android, my quick inks and file list is blank. No errors in debug in Android Studio. If i deactivate this custom gameobject and just run showloaddialog, i get the default Prefab Canvas come up and the file list is shown. Is there something i am not understanding?
from unitysimplefilebrowser.
You must show the file dialog as follows, there is no workaround for it:
yourCustomFileBrowserCanvas.gameObject.SetActive(true);
FileBrowser.ShowLoadDialog(somethingsomething);
As I said, the behaviour on Windows must be a bug, the browser has to be shown with ShowLoadDialog. FileBrowser will use your canvas when ShowLoadDialog is called if your dialog is active in the scene at that time.
from unitysimplefilebrowser.
Ok i think I understand a little more now. Since I am using some custom buttons, i am not sure what the ShowLoadDialog funtion options should be. Can you provide any insight there?
from unitysimplefilebrowser.
You can pass null to onSuccess and onCancel parameters.
from unitysimplefilebrowser.
Do I have to pass anything to the title and button text options or can I leave those out or null?
from unitysimplefilebrowser.
You need to pass the same title and button text or your changes will be overridden. You can modify FileBrowser.cs to ignore those parameters, if you wish. Don't hesitate give it a shot.
from unitysimplefilebrowser.
You must show the file dialog as follows, there is no workaround for it:
yourCustomFileBrowserCanvas.gameObject.SetActive(true); FileBrowser.ShowLoadDialog(somethingsomething);As I said, the behaviour on Windows must be a bug, the browser has to be shown with ShowLoadDialog. FileBrowser will use your canvas when ShowLoadDialog is called if your dialog is active in the scene at that time.
I have tried this, however when I build out to Android and run it on the device, my filebrowser window continues to show empty.
from unitysimplefilebrowser.
Does the Browse... button not show up in quick links section? What are the error messages in logcat?
from unitysimplefilebrowser.
I was able to figure out the issue. There was an issue with upgrading the overall project to the latest version. I am able to open and browse on Android now. However, I need to be able to create directories in C# and write files to them. It is not clear how to use FileBrowserHelpers.CreateFolderInDirectory( string directoryPath, string folderName ) function call as I do not know what the directoryPath variable should be.
from unitysimplefilebrowser.
It is the path returned by FileBrowser.ShowLoadDialog when pickMode is set to Folders. If it is set to Files and you'd like to create a folder in the selected file's parent directory, you'd first have to get that parent directory's path via FileBrowserHelpers.GetDirectoryName.
from unitysimplefilebrowser.
Is there a way with getting a directory listing in c# without interacting with the GUI?
from unitysimplefilebrowser.
Without interacting with the GUI, only persistentDataPath and temporaryCachePath directories can be queried. Storage Access Framework requires us to explicitly ask the user for permission to browse a folder's contents. Hence you see the "Browse..." button in the file browser on Android 10+.
Even if the user had granted permission for e.g. /mnt/0/DCIM folder, you still can't get the files inside it using that raw path. You need the SAF path returned by the file browser. But, if you cache the picked directory's SAF path, later on you can access this directory without interacting with the GUI using that SAF path (as long as the user doesn't delete that directory).
from unitysimplefilebrowser.
I actually do not get the "Browse..." button in the fie browser. I see Primary Drive in the quick links section and the folder list when opening the browser.
from unitysimplefilebrowser.
In that case, you can use C#'s File/Directory API on that device. On Android 11+, always Storage Access Framework is used so my previous message applies to those devices.
from unitysimplefilebrowser.
Related Issues (20)
- File and folder entries are invisible and unclickable in Unity 2021.3.6 HOT 10
- A question about compatibility HOT 4
- file save/load pathes cannot be used on android 13 HOT 1
- Suggestion: Expose DocumentsContract.isChildDocument HOT 3
- Overwrite prompt only works once HOT 3
- MissingReferenceException: The variable m_font of UISkin doesn't exist anymore. HOT 1
- how do you add a link to user sub folder like C:\\Users\<username>\Pictures ? HOT 1
- How to get the SimpleFileBrowserCanvas(Clone) reference after it spawns on my scene in script? HOT 2
- Exclusion not working HOT 1
- Changing skin during runtime throws error HOT 2
- VR Pointer issue when selecting items in File Browser (Oculus/Meta Quest 2) HOT 8
- Android Showing Different Menu HOT 10
- Log Spam: Invalid Unicode Error HOT 6
- WebGL Methods HOT 2
- File Access does not work on quest 2 HOT 3
- Drop Down Text Missing
- GLB and JSON files not appearing Quest Pro HOT 10
- How do I turn off listening for long presses and multiple selections HOT 2
- Whether it supports opening folders on Android phones HOT 1
- Files do not show in playmode HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unitysimplefilebrowser.