Ejemplo n.º 1
0
    public void OnExportModels()
    {
        Debug.Log("Clicked OnExportModels");

        // Only export if we aren't already doing so
        if (!this.isExporting)
        {
            this.modelsToExport = new Queue();
            string allComponents = DataExporter.GetComponentsJson();

            // Get the names of all the prefabs
            string find  = "\"componentprefabname\": \"";
            int    start = allComponents.IndexOf(find);
            while (start >= 0)
            {
                start += find.Length;
                int    end  = allComponents.IndexOf("\",", start);
                string name = allComponents.Substring(start, (end - start));
                this.modelsToExport.Enqueue(name);

                start = allComponents.IndexOf(find, end + 1);
                Debug.Log("Found model name '" + name + "'");
            }

            // Use a coroutine to stop the UI from hanging with the amount of data it needs to process
            StartCoroutine(this.ExportModels());
        }
    }