//Create QuickLinks private void QuickLinks() { for (int i = 0; i < _quickLinkAmount; i++) { FileBrowser.AddQuickLink(_folderFiles[i], _folderPath[i]); } }
void Start() { FileBrowser.SetFilters(true, new FileBrowser.Filter("Imagens", ".jpg", ".png")); FileBrowser.SetDefaultFilter(".jpg"); FileBrowser.SetExcludedExtensions(".lnk", ".tmp", ".zip", ".rar", ".exe"); FileBrowser.AddQuickLink("Área de trabalho", System.Environment.GetFolderPath(System.Environment.SpecialFolder.Desktop), null); }
public IObservable <string> LoadFile() { // Set filters (optional) // It is sufficient to set the filters just once (instead of each time before showing the file browser dialog), // if all the dialogs will be using the same filters FileBrowser.SetFilters(true, new FileBrowser.Filter("Sheets", ".xls", ".xlsx", ".csv")); // Set default filter that is selected when the dialog is shown (optional) // Returns true if the default filter is set successfully // In this case, set Images filter as the default filter FileBrowser.SetDefaultFilter(".xlsx"); // Set excluded file extensions (optional) (by default, .lnk and .tmp extensions are excluded) // Note that when you use this function, .lnk and .tmp extensions will no longer be // excluded unless you explicitly add them as parameters to the function //FileBrowser.SetExcludedExtensions(".lnk", ".tmp", ".zip", ".rar", ".exe"); // Add a new quick link to the browser (optional) (returns true if quick link is added successfully) // It is sufficient to add a quick link just once // Name: Users // Path: C:\Users // Icon: default (folder icon) FileBrowser.AddQuickLink("Users", "C:\\Users", null); return(Observable.FromCoroutine <string>((observer) => ShowLoadDialogCoroutine(observer))); }
void Awake() { audioSource = GetComponent <AudioSource> (); // Set filters (optional) // It is sufficient to set the filters just once (instead of each time before showing the file browser dialog), // if all the dialogs will be using the same filters FileBrowser.SetFilters(true, new FileBrowser.Filter("Music", ".ogg")); // Set default filter that is selected when the dialog is shown (optional) // Returns true if the default filter is set successfully // In this case, set Images filter as the default filter FileBrowser.SetDefaultFilter(".ogg"); // Set excluded file extensions (optional) (by default, .lnk and .tmp extensions are excluded) // Note that when you use this function, .lnk and .tmp extensions will no longer be // excluded unless you explicitly add them as parameters to the function FileBrowser.SetExcludedExtensions(".lnk", ".tmp", ".zip", ".rar", ".exe"); // Add a new quick link to the browser (optional) (returns true if quick link is added successfully) // It is sufficient to add a quick link just once // Name: Users // Path: C:\Users // Icon: default (folder icon) FileBrowser.AddQuickLink("Users", "C:\\Users", null); }
void Start() { FileBrowser.SetFilters(true, new FileBrowser.Filter("Objects", ".obj")); FileBrowser.SetDefaultFilter(".obj"); FileBrowser.SetExcludedExtensions(".lnk", ".tmp", ".zip", ".rar", ".exe"); FileBrowser.AddQuickLink("Resources", @"Assets\", null); }
void Start() { // Retrieve the current save path from the app player preferences and // ensure that the save path button is clickable string savePath = PlayerPrefs.GetString("savePath", emptySavePath); SavePathButton.interactable = true; // If the save path equals the default value, it is not set, so disable the // scene navigation buttons and set the text of the save path button to // indicate that it is yet to be set if (savePath.Equals(emptySavePath)) { RecordingButton.interactable = false; PlaybackButton.interactable = false; SavePathButton.GetComponentInChildren <TextMeshProUGUI>().text = setSavePathText; } else { // Otherwise, a save path is set, so make all buttons interactable and set the // save path button text to indicate that it can be used to change the existing // save path RecordingButton.interactable = true; PlaybackButton.interactable = true; SavePathButton.GetComponentInChildren <TextMeshProUGUI>().text = changeSavePathText; } // Add a quick link to the file browser before it is opened that will allow a user to // easily navigate to the main Users folder on the machine FileBrowser.AddQuickLink("All Users", Directory.GetParent(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)).FullName, null); }
void Start() { RuntimeTerrainGenerator.OnProgression += OnGeneratingTerrainProg; FileBrowser.SetFilters(true, new FileBrowser.Filter("Terrain File", ".flt")); FileBrowser.SetDefaultFilter(".flt"); FileBrowser.SetExcludedExtensions(".lnk", ".tmp", ".zip", ".rar", ".exe"); FileBrowser.AddQuickLink("Data Path", Application.dataPath, null); camera3d = Camera.main.GetComponent <Camera3D>(); camera3d.enabled = false; LoadTerrain.onClick.AddListener(OnLoadBtnClicked); GenerateTerrainBtn.onClick.AddListener(OnGenerateTerrainbtnClicked); terrainPrefs = TerrainPrefs.Get; runTimeTerrainGenerator = RuntimeTerrainGenerator.Get; ElevationMode.onValueChanged.AddListener(OnElevationModeChanged); Terrain_Exaggeration.onValueChanged.AddListener(OnTerrainExaggerationChanged); }
private Dictionary <TaskName, Button> m_pipelineButtons; //dic containing all the buttons of the 'pipeline' panel void Start() { FileBrowser.SetFilters(true, new FileBrowser.Filter("Images", ".jpg", ".png"), new FileBrowser.Filter("Text Files", ".txt", ".pdf")); FileBrowser.SetDefaultFilter(".jpg"); FileBrowser.SetExcludedExtensions(".lnk", ".tmp", ".zip", ".rar", ".exe"); FileBrowser.AddQuickLink("Users", "C:\\Users", null); }
private void OpenFileExplorer() { FileBrowser.SetFilters(true, new FileBrowser.Filter("Audio Files", ".mp3", ".wav")); FileBrowser.SetDefaultFilter(".mp3"); FileBrowser.AddQuickLink("Music", Environment.GetFolderPath(Environment.SpecialFolder.MyMusic)); StartCoroutine(ShowLoadDialogCoroutine()); }
void OpenExplorer() { FileBrowser.SetFilters(true, new FileBrowser.Filter("wav,mp3", ".wav", ".mp3")); FileBrowser.SetDefaultFilter(".wav"); FileBrowser.AddQuickLink("Users", "C:\\Users", null); StartCoroutine(ShowLoadDialogCoroutine()); }
public void DeserializeRobot() { FileBrowser.SetFilters(true, new FileBrowser.Filter("Robots", ".json")); FileBrowser.SetDefaultFilter(".json"); FileBrowser.AddQuickLink("RBSM", saveDir, null); StartCoroutine(ShowLoadDialogCoroutine()); }
public void GetGroupFolderPath() { FileBrowser.AddQuickLink(null, "Users", "C:\\Users"); FileBrowser.SetFilters(true, new FileBrowser.Filter("Text Files", ".csv")); FileBrowser.SetDefaultFilter(".csv"); FileBrowser.ShowLoadDialog(null, null, false, null, "Load", "Select"); StartCoroutine(GetGroupPath()); }
//custom items public void ButtonHandleCustomMap(Toggle toggle) { FileBrowser.SetFilters(true, new FileBrowser.Filter("Images", ".png")); FileBrowser.SetDefaultFilter(".png"); FileBrowser.AddQuickLink("Users", "C:\\Users", null); StartCoroutine(ShowLoadDialogCoroutine(toggle)); }
public void modelImport() { FileBrowser.SetFilters(true, new FileBrowser.Filter("Models", ".obj")); FileBrowser.SetDefaultFilter(".obj"); FileBrowser.SetExcludedExtensions(".lnk", ".tmp", ".zip", ".rar", ".exe"); FileBrowser.AddQuickLink("Users", "C:\\Users", null); StartCoroutine(ShowLoadDialogCoroutine()); }
public void openLoadMenu() { FileBrowser.SetFilters(true, new FileBrowser.Filter("Save File", ".sav")); FileBrowser.SetDefaultFilter(".sav"); FileBrowser.SetExcludedExtensions(".jpg", ".png", ".zip", ".rar", ".exe"); FileBrowser.AddQuickLink("Users", Application.persistentDataPath, null); StartCoroutine(ShowLoadDialogCoroutine()); }
//private static string HexConverter(Color c) //{ // string[] color = // return "#" + c.R.ToString("X2") + c.G.ToString("X2") + c.B.ToString("X2"); //} //void openMenuScreenshot() //{ // //GameObject[] keycaps = GameObject.FindGameObjectsWithTag("Keycaps"); // //string[] baseColor = new string[GameObject.FindGameObjectsWithTag("Keycaps").Length]; // //string[] legendColor = new string[GameObject.FindGameObjectsWithTag("Keycaps").Length]; // //for (int i = 0; i < GameObject.FindGameObjectsWithTag("Keycaps").Length; i++) // //{ // // if (keycaps[i].GetComponent<MeshRenderer>().materials.Length > 1) // // { // // if (keycaps[i].GetComponent<MeshRenderer>().materials[0].color == ) // // } // //} //} void takePicture() { FileBrowser.SetFilters(true, new FileBrowser.Filter("Pictures", ".png")); FileBrowser.SetDefaultFilter(".png"); FileBrowser.SetExcludedExtensions(".jpg", ".zip", ".rar", ".exe"); FileBrowser.AddQuickLink("Users", Application.persistentDataPath, null); StartCoroutine(ShowSaveDialogCoroutine()); }
public void outputSelect() { FileBrowser.SetFilters(true, new FileBrowser.Filter("Texture", ".mtl")); FileBrowser.SetDefaultFilter(".mtl"); FileBrowser.SetExcludedExtensions(".lnk", ".tmp", ".zip", ".rar", ".exe"); FileBrowser.AddQuickLink("Users", "C:\\Users", null); StartCoroutine(ShowLoadDialogCoroutine3()); }
public void LoadProject(ProjectReference project, bool applySite = false) { if (currentFullProject != null && currentFullProject.id == project.id) { btnMyProjects.onClick.Invoke(); homePanelManager.PanelAnim(1); currentFullProject = projectManager.LoadProject(currentFullProject); return; } currentProject = project; //check if main project exists if (File.Exists(project.projectFile)) { try { string json = File.ReadAllText(currentProject.projectFile); RebuildProjects(); btnMyProjects.onClick.Invoke(); homePanelManager.PanelAnim(1); var p = JsonUtility.FromJson <Project>(json); if (applySite) { //load projection site var site = this.projectionSites.sites.OrderByDescending(o => o.majorVersion).ThenByDescending(o => o.minorVersion).FirstOrDefault(f => f.id == p.projectionSite.id); if (site != null) { p.projectionSite = site; } } currentFullProject = projectManager.LoadProject(p); FileBrowser.AddQuickLink("Project", currentFullProject.path, null); FileBrowser.AddQuickLink("Site", _rootPath + projectionSitesFolder + @"\" + currentFullProject.projectionSite.folder, null); //build display list items foreach (Transform child in objDisplayList.transform) { Destroy(child.gameObject); } foreach (var display in displayItems) { var listItem = Instantiate(prefabDisplayListItem, objDisplayList.transform); var displayListItem = listItem.GetComponent <DisplayListItem>(); displayListItem.SetData("Display " + (display.index + 1).ToString(), display.index); displayListItem.OnImageClick += DisplayListItem_OnImageClick; displayListItem.OnVideoClick += DisplayListItem_OnVideoClick; displayListItem.OnProjectorClick += DisplayListItem_OnProjectorClick; } } catch (Exception ex) { ShowErrorMessage("Error Loading Project: " + project.name + "\nPlease check the project.json file is correct", ex); } } else { ShowErrorMessage("Project File Doesn't Exist\n" + project.projectFile); objMessageModalRemoveButton.SetActive(true); } }
public void openSaveMenu() { FileBrowser.SetFilters(true, new FileBrowser.Filter("Save File", ".sav")); // atur file extension yang dapat dibaca oleh file explorer FileBrowser.SetDefaultFilter(".sav"); // set extension filter yang utama FileBrowser.SetExcludedExtensions(".jpg", ".png", ".zip", ".rar", ".exe"); // file extension yang tidak dimasukkan di file explorer FileBrowser.AddQuickLink("Users", Application.persistentDataPath, null); // atur lokasi utama saat pertama buka file explorer StartCoroutine(ShowSaveDialogCoroutine()); // JALAN, tapi persistent data path tidak jalan, dan hasil save tidak muncul. //Debug.Log(Application.persistentDataPath); // JALAN }
// Warning: paths returned by FileBrowser dialogs do not contain a trailing '\' character // Warning: FileBrowser can only show 1 dialog at a time public void OpenDialog() { // Set filters (optional) // It is sufficient to set the filters just once (instead of each time before showing the file browser dialog), // if all the dialogs will be using the same filters FileBrowser.SetFilters(true, new FileBrowser.Filter("RFP File", ".rfp")); // Set default filter that is selected when the dialog is shown (optional) // Returns true if the default filter is set successfully // In this case, set Images filter as the default filter FileBrowser.SetDefaultFilter(".rfp"); // Set excluded file extensions (optional) (by default, .lnk and .tmp extensions are excluded) // Note that when you use this function, .lnk and .tmp extensions will no longer be // excluded unless you explicitly add them as parameters to the function FileBrowser.SetExcludedExtensions(".lnk", ".tmp", ".zip", ".rar", ".exe"); // Add a new quick link to the browser (optional) (returns true if quick link is added successfully) // It is sufficient to add a quick link just once // Name: Users // Path: C:\Users // Icon: default (folder icon) FileBrowser.AddQuickLink("Users", "C:\\Users", null); // Show a save file dialog // onSuccess event: not registered (which means this dialog is pretty useless) // onCancel event: not registered // Save file/folder: file, Allow multiple selection: false // Initial path: "C:\", Initial filename: "Screenshot.png" // Title: "Save As", Submit button text: "Save" // FileBrowser.ShowSaveDialog( null, null, FileBrowser.PickMode.Files, false, "C:\\", "Screenshot.png", "Save As", "Save" ); // Show a select folder dialog // onSuccess event: print the selected folder's path // onCancel event: print "Canceled" // Load file/folder: folder, Allow multiple selection: false // Initial path: default (Documents), Initial filename: empty // Title: "Select Folder", Submit button text: "Select" string initialPath = null; string initialFile = null; if (FileBrowserHelpers.FileExists(fileInput.text)) { initialPath = FileBrowserHelpers.GetDirectoryName(fileInput.text); initialFile = FileBrowserHelpers.GetFilename(fileInput.text); } if (FileBrowserHelpers.DirectoryExists(fileInput.text)) { initialPath = fileInput.text; } FileBrowser.ShowLoadDialog((paths) => { Debug.Log("Selected: " + paths[0]); fileInput.text = paths[0]; }, () => { Debug.Log("Canceled file open"); }, FileBrowser.PickMode.Files, false, initialPath, initialFile); // Coroutine example //StartCoroutine(ShowLoadDialogCoroutine()); }
void Start() { FileBrowser.Filter[] filters = new FileBrowser.Filter[1]; filters[0] = new FileBrowser.Filter("JSON files", ".json"); FileBrowser.SetFilters(true, filters); FileBrowser.SetDefaultFilter(".json"); FileBrowser.SetExcludedExtensions(".lnk", ".tmp", ".zip", ".rar", ".exe"); FileBrowser.AddQuickLink("Resources", @"Assets\Resources\", null); }
private void init_file_dialog() { FileBrowser.SetFilters( true, new FileBrowser.Filter("Network Json Files", ".json") ); FileBrowser.SetDefaultFilter(".json"); FileBrowser.SetExcludedExtensions(".lnk", ".tmp", ".zip", ".rar", ".exe"); FileBrowser.AddQuickLink("Savings", saving_path); }
private void init_file_dialog() { FileBrowser.SetFilters( true, new FileBrowser.Filter("Text Files", ".txt", ".csv") ); FileBrowser.SetDefaultFilter(".txt"); FileBrowser.SetExcludedExtensions(".lnk", ".tmp", ".zip", ".rar", ".exe"); FileBrowser.AddQuickLink("Users", "C:\\Users"); }
/* * [SerializeField] * InputField fieldResInput; * [SerializeField] * Slider fieldResSlider; * float fieldRes = 0.5f; * float FieldRes * { * get { return fieldRes; } * set * { * fieldRes = value; * if (fieldRes <= 1 && fieldRes >= fieldResSlider.minValue) * fieldResSlider.value = fieldRes; * else if (fieldRes >= fieldResSlider.minValue) * fieldResSlider.value = fieldResSlider.maxValue; * fieldResInput.text = fieldRes.ToString(); * } * } */ /* * [SerializeField] * Toggle groundPlaneToggle; * bool groundPlane = true; * * [SerializeField] * InputField minXField; * float minX = -4; * * [SerializeField] * InputField maxXField; * float maxX = 4; * * [SerializeField] * InputField minYField; * float minY = 0; * * [SerializeField] * InputField maxYField; * float maxY = 4; * * [SerializeField] * InputField minZField; * float minZ = -4; * * [SerializeField] * InputField maxZField; * float maxZ = 4; */ // Start is called before the first frame update void Start() { FileBrowser.SetFilters(false, new FileBrowser.Filter("JSON", ".json")); FileBrowser.SetDefaultFilter(".json"); FileBrowser.AddQuickLink("Users", "C:\\Users", null); LoadConfigFile(Application.dataPath + "/Resources/config.json"); ResetFields(); }
public void OpenStencil() { FileBrowser.SetFilters(true, new FileBrowser.Filter("PNG", ".png")); FileBrowser.SetDefaultFilter(".png"); FileBrowser.SetExcludedExtensions(".lnk", ".tmp", ".zip", ".rar", ".exe", ".txt", ".jpg"); FileBrowser.AddQuickLink("Users", "C:\\Users", null); FileBrowser.ShowLoadDialog((path) => { stencil.LoadTexture(path); }, null, false, Directory.GetCurrentDirectory() + "/Assets/Sprites/Pochoir", "Select Stencil", "Select"); }
public void OpenFile() { FileBrowser.SetFilters(true, new FileBrowser.Filter("Images", ".jpg", ".png")); FileBrowser.SetDefaultFilter(".png"); FileBrowser.SetExcludedExtensions(".lnk", ".tmp", ".zip", ".rar", ".exe", ".txt"); FileBrowser.AddQuickLink("Users", "C:\\Users", null); FileBrowser.ShowLoadDialog((path) => { filePathOpen = path; drawer.texture.LoadImage(System.IO.File.ReadAllBytes(path)); }, null, false, Environment.GetFolderPath(Environment.SpecialFolder.MyPictures), "Select Image", "Select"); }
private void OnOpenClickedVRM() { FileBrowser.SetFilters(true, new FileBrowser.Filter("VRM File", ".vrm", ".VRM")); FileBrowser.SetDefaultFilter(".vrm"); FileBrowser.AddQuickLink("Users", "C:\\Users", null); StartCoroutine(ShowLoadDialogModel()); if (string.IsNullOrEmpty(_vrmPath)) { return; } _errorMessagePanel.gameObject.SetActive(false); }
private void OnOpenClickedBVH() { FileBrowser.SetFilters(true, new FileBrowser.Filter("BVH File", ".bvh", ".BVH", ".txt")); FileBrowser.SetDefaultFilter(".bvh"); FileBrowser.AddQuickLink("Users", "C:\\Users", null); StartCoroutine(ShowLoadDialogMotion()); if (string.IsNullOrEmpty(_bvhPath)) { return; } _errorMessagePanel.gameObject.SetActive(false); }
public void SaveFile() { FileBrowser.SetFilters(true, new FileBrowser.Filter("JPEG", ".jpg"), new FileBrowser.Filter("PNG", ".png")); FileBrowser.SetDefaultFilter(".png"); FileBrowser.SetExcludedExtensions(".lnk", ".tmp", ".zip", ".rar", ".exe", ".txt"); FileBrowser.AddQuickLink("Users", "C:\\Users", null); FileBrowser.ShowSaveDialog((path) => { filePathSave = path; File.WriteAllBytes(filePathSave, drawer.texture.EncodeToPNG()); drawer.edit = false; }, null, false, Environment.GetFolderPath(Environment.SpecialFolder.MyPictures), "Save As", "Save"); }
private void OpenFile() { FileBrowser.SetFilters(true, new FileBrowser.Filter("Images", ".jpg", ".png")); FileBrowser.SetDefaultFilter(".png"); FileBrowser.SetExcludedExtensions(".lnk", ".tmp", ".zip", ".rar", ".exe", ".txt"); FileBrowser.AddQuickLink("Users", "C:\\Users", null); FileBrowser.ShowLoadDialog((path) => { filePathOpen = path; drawer.texture.LoadImage(System.IO.File.ReadAllBytes(path)); }, () => { Debug.Log("Canceled"); }, false, Directory.GetCurrentDirectory(), "Select Folder", "Select"); }