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.

../../_images/FileListView-single-click.png

Options

  • File List View FileListView

    FileListView.

  • Confirm Dialog PickerBool

    Dialog to get confirmation if Request Confirmation If File Exists enabled.

  • FilenameInput InputField

    Input for the filename.

  • OkButton Button

    Button to close dialog.

  • FileShouldExists bool

    Selected file should exists.

  • Request Confirmation If File Exists bool

    Show 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");
                            }
                    }
            }
}