Пример #1
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);
        }
Пример #2
0
 private void SetupPrefab(KImprovedFileBrowserButton panel)
 {
     panel.Text.fontSize = ItemFontSize;
     panel.Text.color    = ItemFontColor;
     panel.GetComponent <LayoutElement>().preferredHeight = ItemButtonHeight;
 }