// Use this for initialization void Awak() { DeserializedLevelsLoader d = new DeserializedLevelsLoader( ); if (SceneManager.GetActiveScene().name == "stage1") { d.generateItems("Levels"); return; //PauseController.RestartScene = 1; } if (SceneManager.GetActiveScene().name == "stage2") { d.generateItems("Levels2"); return; //PauseController.RestartScene = 2; } }
// Use this for initialization void Start() { if (loadName.Length > 0) { DeserializedLevelsLoader load = new DeserializedLevelsLoader( ); load.generateItems(loadName); } }
void OnGUI() { // create DeserializedLevelsLoader, Saver and CrossChecker instances init(); // Import section GUILayout.Label("Import", EditorStyles.boldLabel); GUILayout.Label("Import Levels.xml into the scene"); if (GUILayout.Button("Import Levels.xml")) { deserializedLevelsLoader.generateItems(); } // Export section GUILayout.Label("Export", EditorStyles.boldLabel); GUILayout.Label("Export children of \"" + exportGOName + "\" GameObject into " + exportGOName + ".xml", EditorStyles.wordWrappedLabel); if (GUILayout.Button("Export " + exportGOName)) { deserializedLevelsSaver.saveExportItems(); } // Delete section GUILayout.Label("Delete", EditorStyles.boldLabel); GUILayout.Label("Delete " + importGOName + " and " + exportGOName + " GameObjects from scene", EditorStyles.wordWrappedLabel); if (GUILayout.Button("Delete")) { DestroyImmediate(GameObject.Find(importGOName)); DestroyImmediate(GameObject.Find(exportGOName)); } // Cross check section GUILayout.Label("Cross Check", EditorStyles.boldLabel); GUILayout.Label("Cross check /Resources/Prefabs and Levels.xml if there are any item prefabs that exist only in one but not the other", EditorStyles.wordWrappedLabel); if (GUILayout.Button("Cross Check")) { deserializedLevelsCrossChecker.crossCheck(); } }
void Start() { DeserializedLevelsLoader d = new DeserializedLevelsLoader(); d.generateItems(); }