Exemple #1
0
    private IEnumerator doRenderForGlyph(Glyph glyph)
    {
        Debug.Log("Render: Loading " + ApplicationFileManager.GetLocalDownloadPath(glyph));

        if (!ApplicationFileManager.IsGlyphDownloaded(glyph))
        {
            Debug.Log("Render: Downloading");
            ServerCall download = new ServerCall(ServerInteract.DownloadGlyphFromFirebase(glyph));
            yield return(StartCoroutine(download.call()));

            if (download.ReturnException != null)
            {
                statusPanel.showErrorStatus(download.ReturnException.Message);
                throw download.ReturnException;
            }
            //yield return StartCoroutine (ServerInteract.downloadObjectFromAWS (glyph.getPathToContent (), LoadUserData.getLoggedInUser ().getAWSAuthToken ()));
            Debug.Log("Render: Downloading finished");
        }
        else
        {
            Debug.Log("Render: Glyph already downloaded");
        }

        string extension = ApplicationFileManager.GetFileExtension(glyph.GetPathToContent());

        if (extension.Equals(ApplicationFileManager.PNG_EXTENSION))
        {
            Debug.Log("Render: Loading PNG File");
            renderPNGGlyph(glyph);
            Debug.Log("Render: Finished");
        }
        else
        {
            Debug.LogError("Render: Unknown Render Type " + extension);
        }

        yield return("Done");
    }
Exemple #2
0
    private IEnumerator doRenderForGlyph(Glyph glyph)
    {
        Debug.Log("Render: Loading " + ApplicationFileManager.GetLocalDownloadPath(glyph));

        if (!ApplicationFileManager.IsGlyphDownloaded(glyph))
        {
            Debug.Log("Render: Downloading");
            ServerCall download = new ServerCall(ServerInteract.DownloadGlyphFromFirebase(glyph));
            yield return(StartCoroutine(download.call()));

            //yield return StartCoroutine (ServerInteract.downloadObjectFromAWS (glyph.getPathToContent (), LoadUserData.getLoggedInUser ().getAWSAuthToken ()));
            Debug.Log("Render: Downloading finished");
        }
        else
        {
            Debug.Log("Render: Glyph already downloaded");
        }

        string extension = ApplicationFileManager.GetFileExtension(glyph.GetPathToContent());

        if (extension.Equals(ApplicationFileManager.PNG_EXTENSION))
        {
            Debug.Log("Render: Loading PNG File");
            renderPNGGlyph(glyph);
        }
        else
        {
            Debug.Log("Render: Unknown Render Type " + extension);
        }

        ServerCall markGlyphFound = new ServerCall(ServerInteract.INSTANCE.MarkGlyphAsFound(glyph));

        StartCoroutine(markGlyphFound.call());

        Debug.Log("Render: Finished");
        yield return("Done");
    }