Esempio n. 1
0
    void PreparationChecker()
    {
        int           numberOfProjectFoldersBeingPrepared = projectsBeingPrepared.Count;
        List <string> projectsDone = new List <string>();

        for (int i = 0; i < numberOfProjectFoldersBeingPrepared; i++)
        {
            string projectFolder   = projectsBeingPrepared[i];
            int    stateOfResource = WebGL_FileSystem.GetPreparationStateOfResource(projectFolder);
            if (stateOfResource == 3)
            {
                projectsDone.Add(projectFolder);
            }
            else if (stateOfResource == 1)
            {
                Debug.Log("ProjectFolder Failed to Download: " + projectFolder);
                //restart download:
                WebGL_FileSystem.PrepareProjectFolderResource(projectFolder);
            }
        }
        for (int i = 0; i < projectsDone.Count; i++)
        {
            projectsBeingPrepared.Remove(projectsDone[i]);
        }
        if (projectsBeingPrepared.Count != numberOfProjectFoldersBeingPrepared)
        {
            if (projectsBeingPrepared.Count == 0)
            {
                CancelInvoke("PreparationChecker");
                postStart();
            }
        }
    }
Esempio n. 2
0
    IEnumerator Start()
    {
        //  Preemptively load clips.
        HarmonyRenderer renderer = GetComponent <HarmonyRenderer>();

        if ((renderer == null) || (renderer.clipNames == null))
        {
            yield break;
        }

#if UNITY_WEBGL && !UNITY_EDITOR
        if (WebGL_FileSystem.GetPreparationStateOfResource(renderer.projectFolder) != 3)
        {
            renderer.readyToRender = false;
            PrepareProjectFolder(renderer.projectFolder);
        }
        else
        {
            postStart();
        }
#else
        postStart();
#endif
    }