@@ -26,13 +29,28 @@ public class XmlLevelEditor : EditorWindow {
...
@@ -26,13 +29,28 @@ public class XmlLevelEditor : EditorWindow {
GUILayout.Label("Import",EditorStyles.boldLabel);
GUILayout.Label("Import",EditorStyles.boldLabel);
GUILayout.Label("Import Levels.xml into the scene");
GUILayout.Label("Import Levels.xml into the scene");
GUILayout.Label("Level to load: ");
levelToLoad=GUILayout.TextField(levelToLoad);
if(GUILayout.Button("Import Levels.xml"))
if(GUILayout.Button("Import Levels.xml"))
{
{
intlevelIndex=0;
try
{
levelIndex=System.Convert.ToInt32(levelToLoad);
}
catch(FormatExceptione){
Debug.LogWarning("Keine gltige Zahl eingegeben. Lade Level 0");
}
catch(OverflowExceptione2){
Debug.LogWarning("Keine gltige Zahl eingegeben. Lade Level 0");
}
deserializedLevelsLoader.load();
deserializedLevelsLoader.load();
deserializedLevelsLoader.loadLevel();
deserializedLevelsLoader.loadLevel(levelIndex);
}
}
// Export section
// Export section
GUILayout.Label("Export",EditorStyles.boldLabel);
GUILayout.Label("Export",EditorStyles.boldLabel);
GUILayout.Label("Export children of \""+DeserializedLevelsSaver.xmlItemsToExportGOName+"\" GameObject into "+DeserializedLevelsSaver.xmlItemsToExportGOName+".xml",EditorStyles.wordWrappedLabel);
GUILayout.Label("Export children of \""+DeserializedLevelsSaver.xmlItemsToExportGOName+"\" GameObject into "+DeserializedLevelsSaver.xmlItemsToExportGOName+".xml",EditorStyles.wordWrappedLabel);