public void OnClick() { var path = StandaloneFileBrowser.SaveFilePanel(Title, Directory, FileName, Extension); if (!string.IsNullOrEmpty(path)) { File.WriteAllText(path, _data); } }
public void OnSceneLoad() { var paths = StandaloneFileBrowser.OpenFilePanel("Open File", "", "scene", false); if (paths.Length > 0 && paths[0].Length > 0) { LevelEditorMain.Instance.LoadScene(paths[0]); } }
private void OnClick() { var paths = StandaloneFileBrowser.OpenFilePanel(Title, Directory, Extension, Multiselect); if (paths.Length > 0) { StartCoroutine(OutputRoutine(new System.Uri(paths[0]).AbsoluteUri)); } }
void OnClick() { var paths = StandaloneFileBrowser.OpenFilePanel("Browse File", "", "txt", false); if (paths.Length > 0) { StartCoroutine(OutputRoutine(new System.Uri(paths[0]).AbsoluteUri)); } }
public void ExportChip() { string path = StandaloneFileBrowser.SaveFilePanel("Export chip design", "", currentChip.chipName + ".dls", "dls"); if (path.Length != 0) { ChipSaver.Export(currentChip, path); } }
public void SelectHollowKnightExe() { if (finder.Running) { finder.CancelSearch(); } string startingPath = @"C:\Program Files (x86)"; // If program files doesn't exist, start in the user's home folder instead. string[] possibleStartingPaths = { @"C:\Program Files (x86)", Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), Environment.GetFolderPath(Environment.SpecialFolder.Desktop) }; foreach (string p in possibleStartingPaths) { if (!string.IsNullOrEmpty(p) && Directory.Exists(p)) { startingPath = p; break; } } #if UNITY_STANDALONE_LINUX foundGamePath = getHollowKnightExeLinux(startingPath); #else var paths = StandaloneFileBrowser.OpenFolderPanel("Select your Hollow Knight game folder", startingPath, false); foreach (var s in paths) { Debug.Log(s); } if (paths.Length > 0) { string checkPath = paths[0]; if (Directory.Exists(checkPath) && File.Exists(checkPath + "/hollow_knight.exe")) { Settings.gamePath = checkPath; Settings.modsInstallPath = checkPath + "\\" + defaultModInstallFolderName; WriteFoundGamePath(checkPath); } else { System.Windows.Forms.MessageBox.Show("hollow_knight.exe not found in " + checkPath); foundGamePath = false; } } else { foundGamePath = false; } #endif }
public void ExportImage() { _textureBytes = RobotSheet.sprite.texture.EncodeToPNG(); var path = StandaloneFileBrowser.SaveFilePanel("playersheet", "", "playersheet", "png"); if (!string.IsNullOrEmpty(path)) { File.WriteAllBytes(path, _textureBytes); } }
public void Load() { string loadPath = StandaloneFileBrowser.OpenFilePanel("Load Game", "", "pente", false)[0]; if (loadPath != "") { boardManager.LoadNodesFromFile(loadPath); } Init(boardManager.boardSize, true); }
void OnClick_openFile() { ExtensionFilter[] extensions = new[] { new ExtensionFilter("Sound Files", "wav"), new ExtensionFilter("All Files", "*"), }; path = WriteResult(StandaloneFileBrowser.OpenFilePanel("Open File", "", extensions, true)); StartCoroutine(GetAudioClip(path)); }
public void ChangeTexture() { string[] path = StandaloneFileBrowser.OpenFilePanel("360 Image", @"C:\", "", false); imagePath = path[0]; byte[] imageBytes = File.ReadAllBytes(imagePath); Texture2D newTexture = new Texture2D(2, 2); newTexture.LoadImage(imageBytes); m.material.mainTexture = newTexture; }
public void CustomLevel() { string selection = StandaloneFileBrowser.OpenFilePanel("Load rooms file", @"C:\", "json", false).SingleOrDefault(); if (!string.IsNullOrWhiteSpace(selection) && File.Exists(selection)) { ResetLevel(); LayoutTiles.loadPath = selection; } }
public void Button_LoadImage() { Debug.Log("Load image"); var paths = StandaloneFileBrowser.OpenFilePanel("Title", "", "jpg", false); if (paths.Length > 0) { StartCoroutine(LoadMapTexture(new System.Uri(paths[0]).AbsoluteUri)); } }
private void OnOutPutlPathBorwseButtonDown() { var paths = StandaloneFileBrowser.OpenFolderPanel("导出地址", "", true); if (paths.Length > 0) { m_outputPath = paths[0]; XMLUtility.Save(m_savePrefix + "m_outputPath", m_outputPath); } }
private void OnExcelPathBorwseButtonDown() { var paths = StandaloneFileBrowser.OpenFilePanel("配置地址", "", "xlsx", true); if (paths.Length > 0) { m_excelPath = paths[0]; XMLUtility.Save(m_savePrefix + "m_excelPath", m_excelPath); } }
public override void Execute() { string title = $"linyx{DateTime.Now:yyyy-mm-dd-hh-mm-ss}.png"; string path = StandaloneFileBrowser.SaveFilePanel("Save File", "", title, "png"); if (!string.IsNullOrEmpty(path)) { CameraService.CaptureScreenshot(path); } }
/// <summary> /// Popup file choose dialog and call suitable export methothod acording to choosed file type. /// </summary> public void Export() { var label = LeanLocalization.GetTranslation("Export").Text; var newFileName = StandaloneFileBrowser.SaveFilePanel(label, "", fileName, "stl"); if (newFileName != "") { STLExporter.Export(newFileName, new GameObject[] { gameObject }, FileType.Binary); } }
public void SetBackgroundImage() { //string path = EditorUtility.OpenFilePanelWithFilters("Set Stream Pucks Background Image", "", new string []{ "Image Files", "png,jpg,jpeg" }); var extensions = new[] { new ExtensionFilter("Image Files", "png", "jpg", "jpeg") }; string path = StandaloneFileBrowser.OpenFilePanel("Set Background Image", "", extensions, false)[0]; LoadBackgroundImage(path); }
private void OnClick() { var paths = StandaloneFileBrowser.OpenFilePanel("Title", "", "png", false); if (paths.Length > 0) { Debug.Log(new System.Uri(paths[0]).AbsoluteUri); StartCoroutine(OutputRoutine(new System.Uri(paths[0]).AbsoluteUri)); } }
public void ChangeDirectory() { var path = StandaloneFileBrowser.OpenFolderPanel("Select Folder", "", false); if (path.Length != 0) { inputField.text = path[0]; PlayerPrefs.SetString("Path", path[0]); } }
public void OnClickExportData() { if (dr.indexes.Count == 0) { return; } string filePath = StandaloneFileBrowser.SaveFilePanel("Export File", "", "datas", "csv"); DataExporter.ExportData(dr.indexes.ToArray(), dv, filePath); }
public string SaveMapDialog() { if (!MapIsLoaded) { return(""); } string savePath = StandaloneFileBrowser.SaveFilePanel("Save Map", "", LoadedMap.Name, SaveMapExtensions); return(savePath); }
//Standalone File Browser Load Settings public void DesktopFileBrowserLoadWAV() { var extensions = new [] { new ExtensionFilter("Files", "wav") }; string[] paths = StandaloneFileBrowser.OpenFilePanel("Open File", getPath(), extensions, false); if (paths.Length > 0) { PlayAudioFromFile(paths[0]); } }
public void ExportSettings() { string path = StandaloneFileBrowser.SaveFilePanel("Select a folder for export", "", "settings.json", "json"); if (path != null) { string model = JsonUtility.ToJson(ApplicationManager.instance.GlobalSettingsModel.GeneralParameterModel.ResolutionY); System.IO.File.WriteAllText(path, model); } }
public void OnSelectFile() { var paths = StandaloneFileBrowser.OpenFilePanel("Open File", "", "", true); if (paths != null && paths.Length > 0) { pathInput.text = paths[0]; } errorLabel.gameObject.SetActive(false); }
protected override void LeftClick() { var path = StandaloneFileBrowser.OpenFilePanel("Open File", "", "mp3,ogg,wav", false); if (path.Length == 1 && !string.IsNullOrEmpty(path[0])) { this.text.text = Path.GetFileName(path[0]); EditorInitializer.BeatMapMeta.SongFile = path[0]; } }
//画像ファイル選択dialogを開きファイルパスを返す関数 public string OpenDialogAndGetFilePath() { var extensions = new [] { new ExtensionFilter("Image Files", "png", "jpg", "jpeg"), new ExtensionFilter("All Files", "*"), }; var paths = StandaloneFileBrowser.OpenFilePanel("Open File", "", extensions, true); return(paths[0]); }
/// <summary> /// Open file windows for user to select a new output folder /// </summary> public void ChangeOutputPath() { string[] folders = StandaloneFileBrowser.OpenFolderPanel("Select Output Folder", OutputPath, false); if (folders.Length > 0) { OutputPath = folders[0]; PlayerPrefs.SetString("SavePath", OutputPath); _outputPathText.text = OutputPath; } }
private void SaveAsProject() { string file = StandaloneFileBrowser.SaveFilePanel("Save project as...", m_DefaultProjectDir, Singleton.GetDataManager().MetaData.DataName, Globals.XML_FILE_FILTER); file = Path.GetFileNameWithoutExtension(file); // Only continue, if one folder was selected this.SaveProject(file, m_DefaultProjectDir, false); Singleton.GetMainScreenSystem().SetActive(true); }
public void OnClick() { var path = StandaloneFileBrowser.SaveFilePanel("Save SVG as", "", "textile", "svg"); if (!string.IsNullOrEmpty(path)) { WizardController.instance.ToggleProcessingWindow(); StartCoroutine(SaveLocalSVG(path, 0.5f)); } }
public void OnVideoInputClick() { string[] tempArray = StandaloneFileBrowser.OpenFilePanel("Choose your video", PlayerPrefs.GetString("videoInputOldPath"), "", false); if (tempArray.Length > 0) { videoInputPath = tempArray[0]; videoInput.text = videoInputPath.Split('\\').Last(); PlayerPrefs.SetString("videoInputOldPath", videoInputPath.Remove(videoInputPath.Length - videoInput.text.Length)); } }