Example #1
0
    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();
            }
        }
    }
Example #2
0
 void OnDestroy()
 {
     ShareMap.ClearFileWaitingToImport();
     if (!openingWorld)
     {
         SceneManager.LoadScene(Scenes.MENU);
     }
 }