private IEnumerator ClickRoutine() { while (_clickCount != 0) { yield return(new WaitForEndOfFrame()); _currentTime += Time.deltaTime; if (!(_currentTime > _firstClickTime + DoubleClickInterval)) { continue; } if (_clickCount == 1) { _fileBrowser.FileClick(_path); } else { _fileBrowser.FileClick(_path); _fileBrowser.SelectFile(); } _clickCount = 0; } }
// Creates a file button given a file public void CreateFileButton(string file) { GameObject button = Instantiate(FileButtonPrefab, Vector3.zero, Quaternion.identity); // When in Load mode, disable the buttons with different extension than the given file extension if (_fileBrowser.GetMode() == FileBrowserMode.Load) { DisableWrongExtensionFiles(button, file); } SetupButton(button, System.IO.Path.GetFileName(file), FilesParent.transform, () => { _fileBrowser.FileClick(file); }); }