private void sbSelect_Click(object sender, EventArgs e) { if (FileDlg.ShowDialog() == DialogResult.OK) { txtFile.Text = FileDlg.FileName; } }
public static void Load(System.Action <string> handler, string filter = "*") { GameObject go = GameObject.Instantiate(Resources.Load("FileDlg")) as GameObject; FileDlg panel = go.GetComponent <FileDlg>(); if (null != panel) { panel.Init(handler, filter); } }
public void onLoadMap() { string file = PlayerPrefs.GetString(map_file); if (file.Length > 0) { StartCoroutine(loadMap(file)); } else { FileDlg.Load(delegate(string path){ path = "file://" + Path.Combine(path, map_file); StartCoroutine(loadMap(path)); }); } }
public void onSave() { string file = PlayerPrefs.GetString(data_file); if (file.Length > 0) { _save(file); } else { FileDlg.Load(delegate(string path){ path = Path.Combine(path, data_file); _save(path); }); } }
public static extern bool GetSaveFileName([In, Out] FileDlg ofn);