/// <summary>
    ///     - Gets a file with a specified extension.
    /// </summary>
    /// <param name='startingDirectory'>
    ///     - The directory to start the search in.
    /// </param>
    /// <param name='Callback'>
    ///     - The function to call when the file has been selected.
    /// </param>
    /// <param name='extension'>
    ///     - The extension of the desired file type.
    /// </param>
    public static void GetFile(string startingDirectory, SelectFileFunction Callback = null, string extension = ".*")
    {
        if (updater == null)
        {
            updater = new GameObject("Select File");
            updater.AddComponent <FS_Cleanup>();
            updater.hideFlags = HideFlags.HideInHierarchy;
        }

        FileSelector instance = updater.AddComponent <FileSelector>();

        instance.Callback       = Callback;
        instance.extension      = extension;
        instance.path           = startingDirectory;
        instance.destroyOnClose = true;
        instance.open           = true;
    }
 /// <summary>
 ///     - Gets a file with a specified extension.
 /// </summary>
 /// <param name='Callback'>
 ///     - The function to call when the file has been selected.
 /// </param>
 /// <param name='extension'>
 ///     - The extension of the desired file type.
 /// </param>
 public static void GetFile(SelectFileFunction Callback = null, string extension = ".*")
 {
     GetFile(Application.dataPath, Callback, extension);
 }
Exemplo n.º 3
0
	/// <summary>
	/// 	- Gets a file with a specified extension.
	/// </summary>
	/// <param name='Callback'>
	/// 	- The function to call when the file has been selected.
	/// </param>
	/// <param name='extension'>
	/// 	- The extension of the desired file type.
	/// </param>
	public static void GetFile(SelectFileFunction Callback = null, string extension = ".*")
	{
		GetFile(Application.dataPath, Callback, extension);
	}
Exemplo n.º 4
0
	/// <summary>
	/// 	- Gets a file with a specified extension.
	/// </summary>
	/// <param name='startingDirectory'>
	/// 	- The directory to start the search in.
	/// </param>
	/// <param name='Callback'>
	/// 	- The function to call when the file has been selected.
	/// </param>
	/// <param name='extension'>
	/// 	- The extension of the desired file type.
	/// </param>
	public static void GetFile(string startingDirectory, SelectFileFunction Callback = null, string extension = ".*")
	{
		if(updater == null) 
		{
			updater = new GameObject("Select File");
			updater.AddComponent<FS_Cleanup>();
			updater.hideFlags = HideFlags.HideInHierarchy;
		}
		
		FileSelector instance = updater.AddComponent<FileSelector>();
		
		instance.Callback = Callback;
		instance.extension = extension;
		instance.path = startingDirectory;
		instance.destroyOnClose = true;
		instance.open = true;
	}