Esempio n. 1
0
    void OnGUI()
    {
        tab = GUILayout.Toolbar(tab, new string[] { "Import XML", "Export XML", "Vox Files" });

        if (tab == 0)
        {
            drawImportDialog();
        }
        else if (tab == 1)
        {
            GUILayout.Label("Export Level XML", EditorStyles.boldLabel);
            exportRootNode = ((GameObject)EditorGUILayout.ObjectField("Scene to export", exportRootNode, typeof(GameObject)));
            XmlExporter xmlExporter = new XmlExporter();
            if (GUILayout.Button("Export"))
            {
                string savePath = EditorUtility.SaveFilePanel(
                    "Save Teardown scene to XML",
                    "", "", "xml");
                xmlExporter.exportToXML(savePath, exportRootNode);
            }
        }

        groupEnabled = EditorGUILayout.BeginToggleGroup("Optional Settings", groupEnabled);
        myBool       = EditorGUILayout.Toggle("Toggle", myBool);
        myFloat      = EditorGUILayout.Slider("Slider", myFloat, -3, 3);
        EditorGUILayout.EndToggleGroup();
    }
Esempio n. 2
0
        public void export()
        {
            XmlExporter xmlExporter = new XmlExporter();
            string      savePath    = EditorUtility.SaveFilePanel(
                "Save Teardown scene to XML",
                Directory.GetParent(path).FullName,
                Path.GetFileName(path),
                "xml");

            xmlExporter.exportToXML(savePath, gameObject);
        }