void loadMaps() { MapLoaderControler mapLoaderControler = new MapLoaderControler(); MapLoaderOptions options = MapLoaderOptions.NONE; if(separatePrefabByTiledLayers) options |= MapLoaderOptions.SEPARATE_PREFAB_BY_TILED_LAYERS; mapLoaderControler.loadToPrefab = loadToPrefab; mapLoaderControler.prefabRoot = "Assets" + prefabFolder; mapLoaderControler.options = options; int index = 0; int loadedMap = 0; System.Diagnostics.Stopwatch stopWatch = new System.Diagnostics.Stopwatch(); stopWatch.Start(); foreach (FileInfo file in files) { if(selectedFiles[index]){ loadedMap++; mapLoaderControler.loadFile(linker, file); } index++; } float time = stopWatch.ElapsedMilliseconds / 1000f; Debug.Log(string.Format("Loaded {0} maps in {1} s.", loadedMap, time)); }
void reload() { MapLoaderControler mapLoaderControler = new MapLoaderControler(); GameObject go = mapLoaderControler.loadFile(linker, new System.IO.FileInfo(filePath)); go.transform.parent = transform.parent; gameObject.Remove(); }
void showButton() { if (selectedFile == null || selectedFile.Length == 0) { GUI.enabled = false; } if (GUILayout.Button("Load Map")) { mapLoaderControler.loadToPrefab = loadToPrefab; mapLoaderControler.prefabRoot = "Assets" + prefabFolder; Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); mapLoaderControler.loadFile(linker, selectedFile); stopWatch.Stop(); debuglog("Loaded Map in " + stopWatch.ElapsedMilliseconds / 1000f + "s"); } GUI.enabled = true; }
void showButton() { if (selectedFiles == null || selectedFiles.Length == 0) { GUI.enabled = false; } if (GUILayout.Button("Load All Map")) { mapLoaderControler.loadToPrefab = loadToPrefab; mapLoaderControler.prefabRoot = "Assets" + prefabFolder; int index = 0; Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); foreach (FileInfo file in selectedFiles) { mapLoaderControler.loadFile(linker, file); index++; } debuglog("Loaded Map" + index + " in " + stopWatch.ElapsedMilliseconds / 1000f + "s"); } GUI.enabled = true; }