# Unity FileExplorer

A package for Unity containing a runtime file explorer.

## How to Use

 - Add the package to your Unity project
 - Place the Prefab of the Explorer somewhere on a canvas
 - Reference the explorer, open it and wait for the callback to return the selected files:
``` c#
using System.IO;
using Raumgleiter.Packages.FileExplorer;

public class ExplorerDemo : MonoBehaviour {

    //Connections
    [Header("Connections")]    
    public Explorer ExplorerInstance;
    
    
    //***********************************************************************************************************************
    //Events
    
    public OnClickSelectFiles()
    {
        ExplorerInstance.Open(
            ExplorerMode.MultipleFiles,
            OnFilesSelected,
            fileTypeFilter: new string[] { "jpg", "png", "bmp", "pdf", "fbx", "obj", "3ds", "ifc" },
            displayHiddenFiles: false);
    }
    
    
    //------------------------------------------------------------------------------------------------------------------
    
    private void OnFilesSelected(List<string> pathOfSelectedFiles)
    {
        //Path to File not enough? Convert it to FileInfo
        FileInfo[] SelectedFiles = Explorer.PathsToFileInfo(files);
        for (int i = 0; i < SelectedFiles.Count; i++)
        {
            Debug.Log(SelectedFiles[i].FullName);
            Debug.Log(SelectedFiles[i].Name);
            Debug.Log(SelectedFiles[i].Extension);
        }
    }
}
```
