コード例 #1
0
    // Open a file browser to save and load files
    private void OpenFileBrowser(FileBrowserMode fileBrowserMode)
    {
        // Create the file browser and name it
        GameObject fileBrowserObject = Instantiate(FileBrowserPrefab, transform);

        fileBrowserObject.name = "FileBrowser";
        // Set the mode to save or load
        GracesGames.SimpleFileBrowser.Scripts.FileBrowser fileBrowserScript = fileBrowserObject.GetComponent <GracesGames.SimpleFileBrowser.Scripts.FileBrowser>();
        fileBrowserScript.SetupFileBrowser(PortraitMode ? ViewMode.Portrait : ViewMode.Landscape);
        if (fileBrowserMode == FileBrowserMode.Save)
        {
            fileBrowserScript.SaveFilePanel(this, "SaveFileUsingPath", "Microbe Plotter", FileExtension);
        }
        else
        {
            fileBrowserScript.OpenFilePanel(this, "LoadFileUsingPath", FileExtension);
        }
    }