Exemple #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();
            }
        }
    }
Exemple #2
0
 void PrepareProjectFolder(string projectFolder)
 {
     projectsBeingPrepared.Add(projectFolder);
     WebGL_FileSystem.PrepareProjectFolderResource(projectFolder);
     InvokeRepeating("PreparationChecker", 1, 1);
 }