コード例 #1
0
    public void BrowseImageLocation()
    {
        Action <string> onComplete = (string path) =>
        {
            if (path != null)
            {
                FilePathField.text = path;
            }
        };

        FileExplorer.SetFilters("*", "PSD", "TIFF", "JPG", "TGA", "PNG", "GIF", "BMP", "IFF", "PICT");
        FileExplorer.BrowseFile(onComplete);
    }
コード例 #2
0
    public void OnEnable()
    {
        Action <string> onComplete = (string path) =>
        {
            if (path != null && File.Exists(path))
            {
                BasicSettings.Instance.LoadSettingsFrom(path);
                SceneManager.LoadScene((int)EditorScene);
            }
            else
            {
                gameObject.SetActive(false);
            }
        };

        FileExplorer.SetFilters("IRM", "*");
        FileExplorer.BrowseFile(onComplete);


        //using (OpenFileDialog fileBrowser = new OpenFileDialog())
        //{
        //    fileBrowser.Filter = @"Interactive Roleplaying Map|*.irm;*.IRM";
        //    DialogResult result = fileBrowser.ShowDialog();
        //    string path = fileBrowser.FileName;

        //    if (result == DialogResult.OK
        //        && File.Exists(path))
        //    {
        //        BasicSettings.Instance.LoadSettingsFrom(path);
        //        SceneManager.LoadScene((int)EditorScene);
        //    }
        //    else
        //    {
        //        gameObject.SetActive(false);
        //    }
        //}
    }