https://github.com/alessthedev/unity-built-in-file-explorer
This is an unity built in file explorer I made for my game, it has basic features like changing path, select files, shortcuts and filters
https://github.com/alessthedev/unity-built-in-file-explorer
Last synced: about 1 year ago
JSON representation
This is an unity built in file explorer I made for my game, it has basic features like changing path, select files, shortcuts and filters
- Host: GitHub
- URL: https://github.com/alessthedev/unity-built-in-file-explorer
- Owner: AlessTheDev
- Created: 2023-06-25T08:20:30.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-26T09:25:30.000Z (about 2 years ago)
- Last Synced: 2025-02-25T17:48:49.755Z (over 1 year ago)
- Language: ShaderLab
- Size: 2.05 MB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Unity-Built-in-File-Explorer

This is an unity built in file explorer I made for my game, it has basic features like changing path, select files, shortcuts and filters
## Get Started
1. First of all, [download the package zip file](https://github.com/AlessTheDev/Unity-Built-in-File-Explorer/blob/main/FileExplorerPackage.zip) and extract it
2. Open the unity package manager andselect the option "Add project from disk", then select the package.json file from the unzipped folder

3. Wait until the installation is completed
## Set Up
1. Now that we have installed the package in the project let's drag the **FileExplorer** prefab from the Package folder

2. Now add the camera to the canvas and add the UI **Event system**
3. Create an initializer script:
```
public class FileExplorerTest : MonoBehaviour
{
void Start()
{
FileExplorerManager.Instance.Hide(); //IMPORTANT (Initialize the instance, the gameobject must be active)
FileExplorerManager.Instance.Show(); //Call this when you want it to pop up
}
}
```
5. Everything should work!
## Get the selected file
Create a script and add a function to handle the selected file, you can access the file path and name
```
public void HandleSelectedFile()
{
Debug.Log("A file has been selected! " + FileExplorerManager.Instance.GetSelectedFile().filePath);
}
```
Add the function to the event system

## Costumize
To costumize the explorer settings go to the FileExplorer gameobject
### Extension filter

This array defines all the allowed extensions, the other files will be ignored, leane the array blank to allow all files extensions
### Close button
A boolean shows/hides the close button (in case a user MUST select a file)
### Icons

In the FileExplorer gameobject you should be able to find the FileIcons script where you can decide the icons