示例#1
0
    public void Open_Load_Dialog_File()
    {
#if UNITY_WEBGL
        return;
#else
        FileSelector.GetFile(Search_file_load, ".sav");
#endif
    }
示例#2
0
 public void OpenFile()
 {
     if (!windowOpen)
     {
         this.menu.SetActive(false);
         FileSelector.GetFile(GotFile, ".dll");
         windowOpen = true;
     }
 }
示例#3
0
 // Update is called once per frame
 void Update()
 {
     //if we don't have an open window yet, and the spacebar is down...
     if (!windowOpen && Input.GetKeyDown(KeyCode.Space))
     {
         FileSelector.GetFile(GotFile, ".txt"); //generate a new FileSelector window
         windowOpen = true;                     //record that we have a window open
     }
 }
示例#4
0
    //след. диск.
    public void Import_Texture(string nn)
    {
#if UNITY_EDITOR && !UNITY_ANDROID
        Disk(".png");
#endif
#if !UNITY_EDITOR && UNITY_ANDROID
        FileSelector.GetFile(sd_card_path2, GotFile, ".png");
        FonOn();
#endif
        mat_name       = nn;
        windowOpen     = true;
        importing_mesh = false;
    }
示例#5
0
    //след. диск.
    public void Import_Mesh()
    {
#if UNITY_EDITOR
        //  Disk(".obj");
        FileSelector.GetFile("D:/", GotFile, ".obj");
#endif
#if !UNITY_EDITOR && UNITY_ANDROID
        FileSelector.GetFile(sd_card_path2, GotFile, ".obj");
        FonOn();
#endif
        windowOpen     = true;
        importing_mesh = true;
    }
示例#6
0
 //Выбор диска см. GotFile
 public void Disk(string extension)
 {
     disk_scroll.SetActive(true);
     string[] drives = System.IO.Directory.GetLogicalDrives();
     foreach (string str in drives)
     {
         GameObject newButton = Instantiate(button2, disk_directory_content.transform);
         newButton.GetComponentInChildren <Text>().text = str;
         newButton.GetComponent <Button>().onClick.AddListener(delegate {
             FileSelector.GetFile(newButton.GetComponentInChildren <Text>().text, GotFile, extension);
             // FileSelector.GetFile(sd_card_path, GotFile, extension);
             FonOn();
         });
         someshit2.Add(newButton);
     }
 }
示例#7
0
 public void changeSplatmap()
 {
     FileSelector.GetFile(gotSplatmapFile, ".png");
 }
示例#8
0
 public void changeHeightmap()
 {
     FileSelector.GetFile(gotHeightmapFile, ".png");
 }
        /// <summary>
        /// Draws the buttons under the settings for loading and saving
        /// </summary>
        /// <param name="posY">the position of the buttons in Y-Direction so that they are not collide with other controls</param>
        private void DrawSettingButtons(float posY)
        {
            posY += 3 * _padding;               //little space between settings and buttons
            if (Settings.HasTemporaryChanges()) //show the buttons just if there are changes
            {
                if (GUI.Button(new Rect(0, posY, _menuSettingWidth * 0.24f, _buttonHeight),
                               "Save all Settings"))
                {
                    _showOverwriteFileDialog = true;
                }

                //Draw the Discard changes Button just if there are changes
                if (GUI.Button(new Rect(_menuSettingWidth * 0.25f, posY, _menuSettingWidth * 0.25f, _buttonHeight),
                               "Discard changes"))
                {
                    Settings.DiscardTemporaryChanges();
                }
            }
            if (_namesList.Count != 0) //show just if a Menuitem is selected
            {
                //save button
                if (GUI.Button(new Rect(_menuSettingWidth * 0.51f, posY, _menuSettingWidth * 0.24f, _buttonHeight),
                               "Save " + _namesList.First() + " under"))
                {
                    Settings.SaveTemporaryChanges(_namesList.First());
                    _outstandingObjectsToSave.Add(_namesList.First());
                }

                //load button
                if (GUI.Button(new Rect(_menuSettingWidth * 0.76f, posY, _menuSettingWidth * 0.24f, _buttonHeight),
                               "Load " + _namesList.First()))
                {
                    _outstandingObjectsToLoad.Add(_namesList.First());
                }
            }

            //before saving all Files
            if (_showOverwriteFileDialog)
            {
                DialogBoxResult result = DialogBox.Show("create new Files?",
                                                        "Do you want to crate new Files or do you want to overwrite the last-used files", "new Files",
                                                        "overwrite");
                if (result == DialogBoxResult.Cancel) //Cancel = overwrite
                {
                    Settings.SaveTemporaryChanges();
                    Settings.SaveAllSettings();
                    _showOverwriteFileDialog = false;
                }
                else if (result == DialogBoxResult.Ok) //Ok = new Files
                {
                    Settings.SaveTemporaryChanges();
                    _outstandingObjectsToSave.AddRange(Settings.GetMenuItems(new string[0]));
                    _showOverwriteFileDialog = false;
                }
            }

            //show a FileSelector for each object that shall be saved
            if (_outstandingObjectsToSave.Count != 0 && !_fileSelectorIsShowed)
            {
                _fileSelectorIsShowed = true;
                if (String.IsNullOrEmpty(_lastUsedDirectory))
                {
                    FileSelector.GetFile(GotFileToSave, ".xml");
                }
                else
                {
                    FileSelector.GetFile(_lastUsedDirectory, GotFileToSave, ".xml");
                }
            }

            //show a FileSelector for each object that shall be loaded
            if (_outstandingObjectsToLoad.Count != 0 && !_fileSelectorIsShowed)
            {
                _fileSelectorIsShowed = true;
                if (String.IsNullOrEmpty(_lastUsedDirectory))
                {
                    FileSelector.GetFile(GotFileToLoad, ".xml");
                }
                else
                {
                    FileSelector.GetFile(_lastUsedDirectory, GotFileToLoad, ".xml");
                }
            }
        }
示例#10
0
 public void SelectData()
 {
     Options.enabled = false;
     FileSelector.GetFile("/sdcard", LoadData, "data");
 }