Skip to content

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

Notifications You must be signed in to change notification settings

AlessTheDev/Unity-Built-in-File-Explorer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Unity-Built-in-File-Explorer

File Explorer Preview
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 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
    package manager
  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 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
        }
    }
    
  4. 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
On file selected

Costumize

To costumize the explorer settings go to the FileExplorer gameobject

Extension filter

Settings
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

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

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published