Exemple #1
0
    public void ContinueBundleCache()
    {
        EditorPrefs.SetBool("Builder.ContinuePending", false);
        _continueRequired = false;

        try
        {
            string exception = PlayerPrefs.GetString("AssetBundlesDatabaseCacher.Exception");
            if (!string.IsNullOrEmpty(exception))
            {
                throw (System.Exception)BuildUtils.InstantiateByTypeName(exception);
            }

            var cacheDirectory = CachingUtils.GetCacheDirectory(PlayerSettings.companyName, PlayerSettings.productName);
            foreach (var cachePath in Directory.GetDirectories(cacheDirectory))
            {
                string path = Path.Combine(_bundlesCachePath, Path.GetFileName(cachePath));
                Directory.Move(cachePath, path);
            }

            BuildBundleBasedPlayer();
        }
        finally
        {
            FinalizeAll();
            if (UnityEditorInternal.InternalEditorUtility.inBatchMode)
            {
                EditorApplication.Exit(0);
            }
        }
    }