public IEnumerator Initialize(string assetPath) { ActionProgressBar.UpdateProgress("Loading Asset Bundles...", 0f); yield return(null); if (!string.IsNullOrEmpty(assetPath)) { Debug.Log("Loading Bundles..."); FileSystem.Backend = new AssetBundleBackend(assetPath); if (!FileSystem.Backend.isError) { bundlePath = assetPath; GameManifest.Load(); } else { Debug.Log("Error Loading Bundles: " + FileSystem.Backend.loadingError); } } terrainManager = gameObject.GetOrAddComponent <TerrainManager>(); prefabManager = gameObject.GetOrAddComponent <PrefabManager>(); pathManager = gameObject.GetOrAddComponent <PathManager>(); ActionProgressBar.Close(); Debug.Log("Ready!"); }
private IEnumerator SaveMap(string filename) { WorldSerialization blob = new WorldSerialization(); ActionProgressBar.UpdateProgress("Saving Terrain", 0f); yield return(null); yield return(null); terrainManager.Save(ref blob); ActionProgressBar.UpdateProgress("Saving Prefabs", 0.33f); yield return(null); yield return(null); prefabManager.Save(ref blob); ActionProgressBar.UpdateProgress("Saving Paths", 0.66f); yield return(null); yield return(null); pathManager.Save(ref blob); ActionProgressBar.UpdateProgress("Saving File", 0.95f); yield return(null); yield return(null); blob.Save(filename); ActionProgressBar.Close(); }
private void OnPreprocessAsset() { Selection.objects = new Object[0]; WriteTextureMaps(); WritePathData(); UnloadAssetBundles(); ActionProgressBar.Close(); }
private static void OnScriptsReloaded() { if (WorldManager.Instance == null) { WorldManager.Instance = GameObject.FindObjectOfType <WorldManager>(); } if (WorldManager.Instance != null && !string.IsNullOrEmpty(PlayerPrefs.GetString("RustInstallPath"))) { WorldManager.Instance.ValidateFileSystem(); } ActionProgressBar.Close(); }
public IEnumerator CreateNew(int size, int splat, int biome) { yield return(EditorCoroutineUtility.StartCoroutine(Cleanup(), this)); ActionProgressBar.UpdateProgress("Creating New World Data...", 0f); yield return(null); yield return(null); world = World.NewDataFromSize(size, splat, biome); EditorCoroutineUtility.StartCoroutine(LoadMap(world), this); ActionProgressBar.Close(); Debug.Log("World Loaded!"); }
private IEnumerator LoadMap(string filename) { yield return(EditorCoroutineUtility.StartCoroutine(Cleanup(), this)); WorldSerialization blob = new WorldSerialization(); ActionProgressBar.UpdateProgress("Loading Map...", 0f); yield return(null); yield return(null); blob.Load(filename); world = World.WorldToTerrain(blob); yield return(EditorCoroutineUtility.StartCoroutine(LoadMap(world), this)); ActionProgressBar.Close(); Debug.Log("World Loaded!"); }
public IEnumerator Cleanup() { ActionProgressBar.UpdateProgress("Cleaning Map Contents", 0f); yield return(null); yield return(null); if (terrainManager) { ActionProgressBar.UpdateProgress("Destroying Terrain", 0f); yield return(null); yield return(null); terrainManager.Cleanup(); } if (prefabManager) { ActionProgressBar.UpdateProgress("Destroying Prefabs", 0.33f); yield return(null); yield return(null); prefabManager.Cleanup(); } if (pathManager) { ActionProgressBar.UpdateProgress("Destroying Paths", 0.66f); yield return(null); yield return(null); pathManager.Cleanup(); } ActionProgressBar.Close(); }