示例#1
0
        public override IEnumerator DelayedInit()
        {
            m_VocabularySet  = new List <WordDictionary>();
            m_grammarSet     = new List <GrammarDictionary>();
            m_PhrasalVerbSet = new List <WordDictionary>();
            m_ExpressionsSet = new List <WordDictionary>();
            m_IdiomsSet      = new List <WordDictionary>();

            m_Progress.Show();
            m_Progress.SetProgress("Wait..");

            m_Initialized = true;
            int nFilesInLocal = 0;

            // local Pictures folder
            m_LocalPictureDirectory = Path.Combine(Application.persistentDataPath, m_PicturesFolder);
            if (!Directory.Exists(m_LocalPictureDirectory))
            {
                Directory.CreateDirectory(m_LocalPictureDirectory);
            }

            for (int i = 0; i < m_InfoFileList.Count; i++)
            {
                string localDataFolder = Path.Combine(Application.persistentDataPath, m_InfoFileList[i].DataFolderName);

                if (!Directory.Exists(localDataFolder))
                {
                    Directory.CreateDirectory(localDataFolder);
                }

                string indexLocalFileURL = Path.Combine(Application.persistentDataPath, m_InfoFileList[i].FileName);

                Debug.Log("<color=purple>" + "[LauncherController.Initialize]  localDataFolder: " + localDataFolder + " - indexLocalFileURL: " + indexLocalFileURL + "</color>");

                if (File.Exists(indexLocalFileURL))
                {
                    nFilesInLocal++;
                }
            }

            yield return(new WaitForEndOfFrame());

            // Load files
            if (nFilesInLocal == m_InfoFileList.Count)
            {
                if (!LoadLocalData())
                {
                    m_Initialized = false;
                }
            }
            else
            {
                m_Initialized = false;
            }

            yield return(new WaitForEndOfFrame());

            m_Progress.Hide();
        }
示例#2
0
    void RequestDownloads()
    {
        ProgressUI.SetMessage("Downloading files", "Waiting for headers...");
        ProgressUI.Show();

        Debug.Log("Requesting downloads");
        LargeRPC download = new LargeRPC("InitialGameDownload");

        download.ListenForDownload();
        download.OnDownloadComplete += FinishedDownloadingFromHost;
        download.OnProgressUpdated  += UpdateProgressBar;

        CustomMessagingManager.SendNamedMessage("DownloadFilesRequest", NetworkingManager.Singleton.ServerClientId, Stream.Null);
    }