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); }
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); // } //} }