コード例 #1
0
        private void Start()
        {
            // Create the File Browser
            fileBrowser = Instantiate(prefabBrowser).GetComponent <SkywardFileBrowser>();

            // Change some settings
            fileBrowser.Settings.RequireFileExtensionInSaveMode = true;
            fileBrowser.Settings.ShowHiddenFiles = true;

            // There are multiple examples in the asset, so in order to give each file browser it's own settings file
            fileBrowser.Settings.SettingsSaveFileName = "SfbOverlayExampleSettings";

            // Open the File Browser
            OpenFileBrowser(SfbMode.Open, defaultPath, Output, extensions);
        }
コード例 #2
0
    public static SkywardFileBrowser GetCommonFileBrowser()
    {
        if (fileBrowser != null)
        {
            GameObject.Destroy(fileBrowser.gameObject);
        }
        GameObject obj = GameObject.Find("Canvas SkywardFileBrowser");

        if (obj != null)
        {
            GameObject.Destroy(obj);
        }
        fileBrowser = Object.Instantiate(prefabFileBrower).GetComponent <SkywardFileBrowser> ();
        return(fileBrowser);
    }
コード例 #3
0
        private void Start()
        {
            // Add a listener to the switch button so we can switch the File Browser mode with it
            if (switchButton != null)
            {
                switchButton.onClick.AddListener(SwitchButton);
            }

            // Add a listener to the inputfield so we can update the extensions
            if (extensionInputField != null)
            {
                extensionInputField.onEndEdit.AddListener(OnSubmitExtensions);
            }

            // Create the File Browser
            fileBrowser = Instantiate(prefabBrowser).GetComponent <SkywardFileBrowser>();

            // Change some settings
            fileBrowser.Settings.RequireFileExtensionInSaveMode = true;
            fileBrowser.Settings.ShowHiddenFiles = true;

            // Set a canvas for the File Browser
            if (setCustomCanvas && customCanvas != null)
            {
                fileBrowser.SetParentCanvas(customCanvas);
            }

            // Set a fake file system so we can simulate the file system of our in-game computer
            if (setFakeFileSystem && FakeFileSystemJSON != null)
            {
                fileBrowser.FakeFileSystem(SfbFileSystem.CreateFromJSON(FakeFileSystemJSON.text));
            }

            // There are multiple examples in the asset, so in order to give each file browser it's own settings file
            fileBrowser.Settings.SettingsSaveFileName = "SfbInGameExampleSettings";

            // Open the File Browser
            OpenFileBrowser(SfbMode.Open, defaultPath, Output, extensions);
        }
コード例 #4
0
ファイル: Browser.cs プロジェクト: Cygnusfear/BucketPreviewer
    private void Start()
    {
        // Create the File Browser
        fileBrowser = Instantiate(prefabBrowser).GetComponent <SkywardFileBrowser>();

        fileBrowser.Settings.ShowHiddenFiles = true;

        fileBrowser.Settings.SettingsSaveFileName = "SfbOverlayExampleSettings";

                #if UNITY_STANDALONE_OSX
        defaultPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
                #endif

                #if UNITY_EDITOR_OSX
        defaultPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
                #endif

                #if UNITY_STANDALONE_WIN
        defaultPath = Environment.SpecialFolder.Personal;
                #endif
        // Open the File Browser
        Open();
    }