FileDialog
If you want to open directories and select files with a single click
instead of the double-click just move FileListView.DefaultItem
DoubleClick callback to OnClick event.
Note
See Windows Animations for open and closed animations.
Options
File List View
FileListViewFileListView.
Confirm Dialog
PickerBoolDialog to get confirmation if Request Confirmation If File Exists enabled.
FilenameInput
InputFieldInput for the filename.
OkButton
ButtonButton to close dialog.
FileShouldExists
boolSelected file should exists.
Request Confirmation If File Exists
boolShow Confirm Dialog if file exists.
Code examples
namespace UIWidgets.Examples
{
using UIWidgets;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// Test FileDialog.
/// </summary>
public class TestColorPickerDialog : MonoBehaviour
{
[SerializeField]
ColorPickerDialog Dialog;
[SerializeField]
Image Image;
async public void Test()
{
var result = await Dialog.Clone().ShowAsync(Image.color);
if (result.Success)
{
Image.color = result.Value;
Debug.Log("value: " + result.Value);
}
else
{
Debug.Log("canceled");
}
}
}
}