Exemplo n.º 1
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, Path.GetFileName(file), FilesParent.transform, () => { _fileBrowser.FileClick(file); });
        }
Exemplo n.º 2
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, Path.GetFileName(file), FilesParent.transform);
            // Setup FileButton script for file button (handles click and double click event)
            button.GetComponent <FileButton>().Setup(_fileBrowser, file, button.GetComponent <Button>().interactable);
        }
Exemplo n.º 3
0
        // Creates a file button given a file
        public void CreateFileButton(string file)
        {
            KImprovedFileBrowserButton button = Instantiate(FileButtonPrefab, FilesContainer);

            // 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, Path.GetFileName(file));
            // Setup FileButton script for file button (handles click and double click event)
            button.GetComponent <FileButton>().Setup(_fileBrowser, file, button.Button.interactable);
        }