Example #1
0
    IEnumerator ShowSaveDialogCoroutine()
    {
        FileBrowser.SetFilters(true, new FileBrowser.Filter("txt", ".txt"));
        FileBrowser.SetDefaultFilter(".txt");

        // Show a save file dialog and wait for a response from user
        // save file/folder: file, Initial path: default (Documents), Title: "Load File", submit button text: "Load"
        yield return(FileBrowser.WaitForLoadDialog(false, null, "Load Results File", "Load"));

        // Dialog is closed
        // Print whether a file is chosen (FileBrowser.Success)
        // and the path to the selected file (FileBrowser.Result) (null, if FileBrowser.Success is false)
        Debug.Log(FileBrowser.Success + " " + FileBrowser.Result);
        if (FileBrowser.Success)
        {
            filePath = FileBrowser.Result;
            ResultsLoader.SetResultsPath(filePath);
        }
    }
Example #2
0
    // Update is called once per frame
    void Update()
    {
        if (firstLoad)
        {
            if (objImporter.AllImported)
            {
                Camera.main.GetComponent <CameraController>().WhenLoadedCamera();
                ResultsLoader.WhenLoadedResults();
                firstLoad  = false;
                secondLoad = true;
            }
        }

        if (secondLoad)
        {
            secondLoad = false;

            /*
             * GameObject obj = loadedObject.GetComponentInChildren<GameObject>();
             * //StartCoroutine(Wait());
             */
            Renderer[] rend = loadedObject.GetComponentsInChildren <Renderer>();
            Instantiate(loadedObject.gameObject.transform.GetChild(0).gameObject, loadedObject.transform);

            for (int i = 0; i < rend.Length; i++)
            {
                rend[i].material.shader = Shader.Find("Unlit/Color");
                rend[i].material.color  = Color.red;
            }
            //rend.material.shader = Shader.Find("Unlit/Color");
            //rend.material.color = Color.red;
            //LoadObject();
            progressText.enabled = false;
            loadButton.SetActive(false);
        }
        if (fpdone)
        {
            LoadObject();
            fpdone    = false;
            firstLoad = true;
        }
    }