Simple File Browser [Open Source]

You can use CTRL or Shift keys to multi-select. On mobile, IIRC, pressing and holding on a file will show the multiple selection toggles.

I’m working in VR, is there a way to customize the controls?

You can modify the source code to make the multi selection toggles always visible. FileBrowser’s MultiSelectionToggleSelectionMode property should be of particular interest.

	private bool m_multiSelectionToggleSelectionMode = true;
	internal bool MultiSelectionToggleSelectionMode
	{
		get { return true; }
		private set
		{
			if( m_multiSelectionToggleSelectionMode != true )
			{
				m_multiSelectionToggleSelectionMode = true;

				for( int i = 0; i < allItems.Count; i++ )
				{
					if( allItems[i].gameObject.activeSelf )
						allItems[i].SetSelected( selectedFileEntries.Contains( allItems[i].Position ) );
				}
			}
		}
	}

This is what I changed to have the toggles always visible, but I’m still not able to select multiple files. I have a tracked device graphic raycaster to be able to interact with the canvas in VR, and I can select everything else in the canvas using the A button on my XBox which I’ve set in my XRI Input Action system, except for the toggles. Any idea what could be happening?

EDIT: Nevermind, figured out a workaround that doesn’t require me to do all this. Thanks for you help!

1 Like

Glad to hear it. May I ask how you resolved it?

I didn’t change anything else in the source code. TBH I wasn’t able to find a way to change the controls, but the maximum amount of files I need the player to select in my game is two, so I just made it so that you have to select one file at a time.

1 Like

Hello, thank you for the great asset. It works perfectly in the editor. I was successful displaying the browser, but it shows only the local files on the device. Would it be possible to access the files on the PC using your browser via USB-C cable? If so, how can I achieve it? I’m quite new to Unity and would greatly appreciate your input. Thanks!

I don’t seem to be able to post it as a separate question.

Hi, from which device (Android?) are you attempting to read the files on PC? On standalone platforms, USB drives are supposed to be recognized automatically. On Android 31+ and iOS, this isn’t supported. Earlier Android versions may detect USB drives but I don’t think you can access PC’s files from Android.

Hi, thanks for replying. I’m using Meta Quest Pro (https://www.meta.com/quest/quest-pro/). Its OS is build on Android 10, but is heavily modified for the VR headset.

I see. If I connect my Android device to Windows, I can see my phone’s files on PC but I can’t see my PC’s files on my phone. If you are able to see your PC’s files on Quest Pro using Quest Pro’s built-in file browser app (I’m assuming it has one), then check if my file browser shows a “Browse…” button inside the quick links section to the left. If it does, then Storage Access Framework is used and perhaps removing it would help: File Access does not work on quest 2 · Issue #87 · yasirkula/UnitySimpleFileBrowser · GitHub. Otherwise I don’t think this can be achieved in my file browser.

Hello, sir, it’s the first time for me to use your plug-in, but as a novice of unity, I don’t know how to use your plug-in, especially how to configure scripts. I wonder if you have any examples of how to use the plug-in.Thank you very much.

Hi, can you check out the example code on GitHub: GitHub - yasirkula/UnitySimpleFileBrowser: A uGUI based runtime file browser for Unity 3D (draggable and resizable)

I think u are talking to a bot.

Yes, you can directly display the file browser via code. No need to add the prefab to your scene. If you wish to use a World Space Canvas dialog, then you can place the prefab in your scene and modify it as you wish to achieve that.