private IEnumerator LoadWorldCoroutine(string path = null, System.IO.Stream stream = null) { loadingWorld = true; errorMessage = null; yield return(null); yield return(null); try { if (stream != null) { dataList = ReadWorldFile.ReadEmbeddedData(stream, type); } else { dataList = ReadWorldFile.ReadEmbeddedData(path, type); } } catch (MapReadException e) { errorMessage = e.Message; Debug.LogError(e.InnerException); } finally { loadingWorld = false; if (stream != null) { stream.Close(); ShareMap.ClearFileWaitingToImport(); } } }
void OnDestroy() { ShareMap.ClearFileWaitingToImport(); if (!openingWorld) { SceneManager.LoadScene(Scenes.MENU); } }