/// <summary>
        /// Creates the AssetLoaderOptions instance, configures the Web Request, and downloads the Model.
        /// </summary>
        /// <remarks>
        /// You can create the AssetLoaderOptions by right clicking on the Assets Explorer and selecting "TriLib->Create->AssetLoaderOptions->Pre-Built AssetLoaderOptions".
        /// </remarks>
        private void Start()
        {
            var assetLoaderOptions = AssetLoader.CreateDefaultLoaderOptions();
            var webRequest         = AssetDownloader.CreateWebRequest("https://ricardoreis.net/trilib/demos/sample/TriLibSampleModel.zip");

            AssetDownloader.LoadModelFromUri(webRequest, OnLoad, OnMaterialsLoad, OnProgress, OnError, null, assetLoaderOptions);
        }
Exemplo n.º 2
0
    ///<summary>
    /// Replace the box GameObject by the given fbx model
    ///</summary>
    ///<param name="_object">The Object to update</param>
    ///<param name="_modelPath">The path of the 3D model to load with TriLib</param>
    public async Task ReplaceBox(GameObject _object, string _modelPath)
    {
        isLocked = true;

        Uri filePath = new Uri($"{GameManager.gm.configLoader.GetCacheDir()}/{_object.name}.fbx");

        await DownloadFile(_modelPath, filePath.AbsolutePath);

        AssetLoaderOptions assetLoaderOptions = AssetLoader.CreateDefaultLoaderOptions();

        // BoxCollider added later
        assetLoaderOptions.GenerateColliders = false;
        assetLoaderOptions.ConvexColliders   = false;
        assetLoaderOptions.AlphaMaterialMode = TriLibCore.General.AlphaMaterialMode.None;

        if (File.Exists(filePath.AbsolutePath))
        {
            Debug.Log($"From file: {filePath.AbsolutePath}");
            AssetLoader.LoadModelFromFile(filePath.AbsolutePath, OnLoad, OnMaterialsLoad, OnProgress, OnError,
                                          _object, assetLoaderOptions);
        }
        else
        {
            Debug.Log($"From url: {_modelPath}");
            UnityWebRequest webRequest = AssetDownloader.CreateWebRequest(_modelPath);
            AssetDownloader.LoadModelFromUri(webRequest, OnLoad, OnMaterialsLoad, OnProgress, OnError,
                                             _object, assetLoaderOptions, null, "fbx");
        }
        while (isLocked)
        {
            await Task.Delay(10);
        }
    }
Exemplo n.º 3
0
        private void Init()
        {
            GameManager instanceDirect = MonoSingleton <GameManager> .GetInstanceDirect();

            GameManager gameManager;

            if (Object.op_Inequality((Object)instanceDirect, (Object)null))
            {
                Object.DestroyImmediate((Object)instanceDirect);
                gameManager = (GameManager)null;
            }
            CriticalSection.ForceReset();
            SRPG_TouchInputModule.UnlockInput(true);
            PunMonoSingleton <MyPhoton> .Instance.Disconnect();

            UIUtility.PopCanvasAll();
            AssetManager.UnloadAll();
            AssetDownloader.Reset();
            AssetDownloader.ResetTextSetting();
            Network.Reset();
            gameManager = MonoSingleton <GameManager> .Instance;
            GameUtility.ForceSetDefaultSleepSetting();
            if (GameUtility.IsStripBuild)
            {
                GameUtility.Config_UseAssetBundles.Value = true;
            }
            LocalizedText.UnloadAllTables();
        }
Exemplo n.º 4
0
 public void DownloadAssetID(int id, string saveLoc)
 {
     foreach (var item in aID.GetAssets(id))
     {
         AssetDownloader.DownloadAssetID(item, saveLoc);
     }
 }
Exemplo n.º 5
0
        private void RefreshEnemyList()
        {
            if (Object.op_Equality((Object)this.EnemyPlayerList, (Object)null) || Object.op_Equality((Object)this.EnemyPlayerItem, (Object)null))
            {
                return;
            }
            this.EnemyPlayerList.ClearItems();
            ArenaPlayer[] arenaPlayers = MonoSingleton <GameManager> .Instance.ArenaPlayers;
            Transform     transform    = ((Component)this.EnemyPlayerList).get_transform();

            for (int index = 0; index < arenaPlayers.Length; ++index)
            {
                ListItemEvents listItemEvents = (ListItemEvents)Object.Instantiate <ListItemEvents>((M0)this.EnemyPlayerItem);
                DataSource.Bind <ArenaPlayer>(((Component)listItemEvents).get_gameObject(), arenaPlayers[index]);
                listItemEvents.OnSelect     = new ListItemEvents.ListItemEvent(this.OnEnemySelect);
                listItemEvents.OnOpenDetail = new ListItemEvents.ListItemEvent(this.OnEnemyDetailSelect);
                this.EnemyPlayerList.AddItem(listItemEvents);
                ((Component)listItemEvents).get_transform().SetParent(transform, false);
                ((Component)listItemEvents).get_gameObject().SetActive(true);
                AssetManager.PrepareAssets(AssetPath.UnitSkinImage(arenaPlayers[index].Unit[0].UnitParam, arenaPlayers[index].Unit[0].GetSelectedSkin(-1), arenaPlayers[index].Unit[0].CurrentJobId));
            }
            if (AssetDownloader.isDone)
            {
                return;
            }
            AssetDownloader.StartDownload(false, true, ThreadPriority.Normal);
        }
Exemplo n.º 6
0
 public override void OnActivate(int pinID)
 {
     if (pinID == 0)
     {
         AssetDownloader.DestroyAssetStart(this.flags);
     }
     this.ActivateOutputLinks(1);
 }
Exemplo n.º 7
0
        public void AssetDownloader_ReturnsTrueIfImageExists()
        {
            var assetDownloader = new AssetDownloader <string>(Path.GetTempPath(), key => $"https://art.hearthstonejson.com/v1/256x/{key}.jpg", key => $"{key}.jpg");
            var awaiting        = assetDownloader.DownloadAsset(WispCardId);

            Task.WaitAny(awaiting, Task.Delay(10000));
            Assert.IsTrue(awaiting.Result);
        }
        public void AssetDownloader_ReturnsTrueIfImageDoesNotExist()
        {
            var assetDownloader = new AssetDownloader(Path.GetTempPath(), "https://art.hearthstonejson.com/v1/256x", (string cardId) => $"{cardId}.jpg");
            var awaiting        = assetDownloader.DownloadAsset("");

            Task.WaitAny(awaiting, Task.Delay(10000));
            Assert.IsFalse(awaiting.Result);
        }
Exemplo n.º 9
0
        /// <summary>Loads a model from a URL.</summary>
        protected void LoadModelFromURL(UnityWebRequest request, string fileExtension, GameObject wrapperGameObject = null, object customData = null, Action <AssetLoaderContext> onMaterialsLoad = null)
        {
            HideModelUrlDialog();
            SetLoading(true);
            OnBeginLoadModel(true);
            fileExtension = fileExtension.ToLowerInvariant();
            var isZipFile = fileExtension == "zip" || fileExtension == ".zip";

            AssetDownloader.LoadModelFromUri(request, OnLoad, onMaterialsLoad ?? OnMaterialsLoad, OnProgress, OnError, wrapperGameObject, AssetLoaderOptions, customData, isZipFile ? null : fileExtension, isZipFile);
        }
Exemplo n.º 10
0
        /// <summary>
        /// Shows the URL selector for loading a model from network.
        /// </summary>
        public void LoadModelFromURLWithDialogValues()
        {
            if (string.IsNullOrWhiteSpace(_modelUrl.text))
            {
                return;
            }
            var request       = AssetDownloader.CreateWebRequest(_modelUrl.text);
            var fileExtension = FileUtils.GetFileExtension(request.uri.Segments[request.uri.Segments.Length - 1], false);

            LoadModelFromURL(request, fileExtension);
        }
Exemplo n.º 11
0
 private void DownloadLocalizedAssetAndDependencies(AssetList.Item node, AssetList assetList)
 {
     if (node == null)
     {
         return;
     }
     if (!node.Exist)
     {
         AssetDownloader.Add(node.IDStr);
     }
     for (int index = 0; index < node.Dependencies.Length; ++index)
     {
         if (!File.Exists(AssetDownloader.CachePath + node.Dependencies[index].IDStr))
         {
             AssetDownloader.Add(node.Dependencies[index].IDStr);
         }
     }
     for (int index = 0; index < node.AdditionalDependencies.Length; ++index)
     {
         string         path = AssetDownloader.CachePath + node.AdditionalDependencies[index].IDStr;
         string         localizedObjectName = AssetManager.GetLocalizedObjectName(node.AdditionalDependencies[index].Path, false);
         AssetList.Item itemByPath          = assetList.FindItemByPath(localizedObjectName);
         if (localizedObjectName == node.AdditionalDependencies[index].Path || itemByPath == null)
         {
             if (!File.Exists(path))
             {
                 AssetDownloader.Add(node.AdditionalDependencies[index].IDStr);
             }
         }
         else if (!File.Exists(AssetDownloader.CachePath + itemByPath.IDStr))
         {
             AssetDownloader.Add(itemByPath.IDStr);
         }
     }
     for (int index = 0; index < node.AdditionalStreamingAssets.Length; ++index)
     {
         string         path = AssetDownloader.CachePath + node.AdditionalStreamingAssets[index].IDStr;
         string         localizedObjectName = AssetManager.GetLocalizedObjectName(node.AdditionalStreamingAssets[index].Path, false);
         AssetList.Item itemByPath          = assetList.FindItemByPath(localizedObjectName);
         if (localizedObjectName == node.AdditionalStreamingAssets[index].Path || itemByPath == null)
         {
             if (!File.Exists(path))
             {
                 AssetDownloader.Add(node.AdditionalStreamingAssets[index].IDStr);
             }
         }
         else if (!File.Exists(AssetDownloader.CachePath + itemByPath.IDStr))
         {
             DebugUtility.LogWarning("Downloading localized streaming dependency: " + localizedObjectName);
             AssetDownloader.Add(itemByPath.IDStr);
         }
     }
 }
Exemplo n.º 12
0
 public static void Reset()
 {
     AssetDownloader.mHasError  = false;
     AssetDownloader.mCoroutine = (Coroutine)null;
     AssetDownloader.mRequestIDs.Clear();
     if (!Object.op_Inequality((Object)AssetDownloader.mInstance, (Object)null))
     {
         return;
     }
     Object.Destroy((Object)((Component)AssetDownloader.mInstance).get_gameObject());
     AssetDownloader.mInstance = (AssetDownloader)null;
 }
Exemplo n.º 13
0
        /// <summary>
        /// Loads the part with the given index from the given area.
        /// </summary>
        /// <param name="partName">The area name to load (hair, eyes, nose or mouth).</param>
        /// <param name="partIndex">The area part index.</param>
        private void LoadPart(string partName, int partIndex)
        {
            var wrapper = GameObject.Find($"{partName}Wrapper");

            if (wrapper == null)
            {
                return;
            }
            var request = AssetDownloader.CreateWebRequest($"{BaseURI}{partName}{partIndex}.zip");

            AssetDownloader.LoadModelFromUri(request, OnLoad, OnMaterialsLoad, OnProgress, OnError, wrapper, AssetLoaderOptions, partIndex, null, true);
        }
Exemplo n.º 14
0
        /// <summary>
        /// Grabs a fresh copy of the manifest file
        /// </summary>
        private static void GrabManifest()
        {
            Log.Write("Grabbing manifest list from server...");
            downloader = new AssetDownloader();
            downloader.CurrentDirectory = DownloadLocation;

            downloader.CurrentUrl = CurrentUrl;

            downloader.OnUpdateComplete += UpdateComplete;

            downloader.DownloadAssetList(manifest, false);
        }
Exemplo n.º 15
0
    public virtual void Awake()
    {
        _instance     = this;
        m_downLoader  = new Downloader();
        m_assetLoader = new AssetDownloader();
        m_iconLoader  = new IconDownloader();
        m_downLoader.Init();
        m_assetLoader.Init();
        m_iconLoader.Init();

        MsgHandler.Instance.Init();
        //m_servers.Add(MsgCenter._instance.WWWURL);
    }
Exemplo n.º 16
0
        /// <summary>
        /// Starts our downloading process
        /// </summary>
        public static void Begin()
        {
            Program.running = true;

            Log.Write("Grabbing hash list from server...");

            downloader = new AssetDownloader();
            downloader.CurrentDirectory = DownloadLocation;

            downloader.CurrentUrl = CurrentUrl;

            downloader.OnUpdateComplete += GrabManifest;

            downloader.DownloadAssetList(hashList, true);
        }
Exemplo n.º 17
0
        private void SyncAssets(string contentPath)
        {
            var sw = Stopwatch.StartNew();

            // Synchronize the assets with the asset server.
            using (var downloader = new AssetDownloader(_config.MasterHash, new Uri(_config.ContentUrl)))
            {
                downloader.DownloadProgressChanged += (sender, e) =>
                                                      Logs.Info(!e.WasDownloaded ? $"Synced asset '{e.FileDownloaded.Path}'... {Math.Round(e.ProgressPercentage, 2)}%" :
                                                                $"Synced asset & downloaded '{e.FileDownloaded.Path}'... {Math.Round(e.ProgressPercentage, 2)}% ");
                downloader.DownloadCompleted += (sender, e) => Logs.Info($"Syncing completed in {sw.Elapsed.TotalMilliseconds}ms.");

                downloader.DownloadAssets(contentPath);
            }
        }
Exemplo n.º 18
0
 /// <summary>
 /// Initiates our asset list downloading
 /// </summary>
 private void AssetDownloadController(string baseUrlDirectory)
 {
     if (baseUrlDirectory == null)
     {
         throw new ArgumentNullException("baseUrlDirectory");
     }
     this.downloadList       = new List <AssetDownloader.AssetDescriptor>();
     this.numFilesDownloaded = 0;
     this.numTotalDownloads  = 0;
     this.assetDownloader    = new AssetDownloader(baseUrlDirectory);
     this.assetDownloader.OnAssetFileListDownloadProgressChanged += new AssetDownloader.AssetFileListDownloadProgressChanged(this.OnAssetFileListDownloadProgressChanged);
     this.assetDownloader.OnAssetFileListDownloadCompleted       += new AssetDownloader.AssetFileListDownloadCompleted(this.OnAssetFileListDownloadCompleted);
     this.assetDownloader.OnAssetDownloadBegin           += new AssetDownloader.AssetDownloadBegin(this.OnAssetDownloadBegin);
     this.assetDownloader.OnAssetDownloadProgressChanged += new AssetDownloader.AssetDownloadProgressChanged(this.OnAssetDownloadProgressChanged);
     this.assetDownloader.OnAssetDownloadCompleted       += new AssetDownloader.AssetDownloadCompleted(this.OnAssetDownloadCompleted);
 }
Exemplo n.º 19
0
        private void RefreshEnemyList()
        {
            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.EnemyPlayerList, (UnityEngine.Object)null) || UnityEngine.Object.op_Equality((UnityEngine.Object) this.EnemyPlayerItem, (UnityEngine.Object)null))
            {
                return;
            }
            this.EnemyPlayerList.ClearItems();
            ArenaPlayer[] arenaPlayers = MonoSingleton <GameManager> .Instance.ArenaPlayers;
            Transform     transform    = ((Component)this.EnemyPlayerList).get_transform();

            for (int index = 0; index < arenaPlayers.Length; ++index)
            {
                ListItemEvents listItemEvents = (ListItemEvents)UnityEngine.Object.Instantiate <ListItemEvents>((M0)this.EnemyPlayerItem);
                DataSource.Bind <ArenaPlayer>(((Component)listItemEvents).get_gameObject(), arenaPlayers[index]);
                listItemEvents.OnSelect     = new ListItemEvents.ListItemEvent(this.OnEnemySelect);
                listItemEvents.OnOpenDetail = new ListItemEvents.ListItemEvent(this.OnEnemyDetailSelect);
                this.EnemyPlayerList.AddItem(listItemEvents);
                ((Component)listItemEvents).get_transform().SetParent(transform, false);
                ((Component)listItemEvents).get_gameObject().SetActive(true);
                AssetManager.PrepareAssets(AssetPath.UnitSkinImage(arenaPlayers[index].Unit[0].UnitParam, arenaPlayers[index].Unit[0].GetSelectedSkin(-1), arenaPlayers[index].Unit[0].CurrentJobId));
            }
            if (!AssetDownloader.isDone)
            {
                AssetDownloader.StartDownload(false, true, ThreadPriority.Normal);
            }
            if (!UnityEngine.Object.op_Implicit((UnityEngine.Object) this.GoMapInfo))
            {
                return;
            }
            GameManager instance = MonoSingleton <GameManager> .Instance;
            PlayerData  player   = instance.Player;

            if (!UnityEngine.Object.op_Implicit((UnityEngine.Object)instance) || player == null)
            {
                return;
            }
            DataSource component = (DataSource)this.GoMapInfo.GetComponent <DataSource>();

            if (UnityEngine.Object.op_Implicit((UnityEngine.Object)component))
            {
                component.Clear();
            }
            DataSource.Bind <QuestParam>(this.GoMapInfo, instance.FindQuest(GlobalVars.SelectedQuestID));
            GameParameter.UpdateAll(this.GoMapInfo);
            this.mIsUpdateMapInfoEndAt = this.RefreshMapInfoEndAt();
        }
Exemplo n.º 20
0
    public void StartDownload()
    {
        m_bDownloading = true;
        string szVersion = GameInstance.Instance().proServerUrl
                           + string.Format(GameInstance.Instance().proServerPlatformContentPath,
                                           VersionManager.Instance().GetVersionUrl(), SysUtil.GetPlatformName())
                           + "?" + Time.realtimeSinceStartup.ToString();

        AssetDownloader.Instance().AddURL(szVersion);
        string szVersionContent = GameInstance.Instance().proServerUrl
                                  + string.Format(GameInstance.Instance().proServerVersionContent, VersionManager.Instance().GetVersionUrl())
                                  + "?" + Time.realtimeSinceStartup.ToString();

        AssetDownloader.Instance().AddURL(szVersionContent);
        //AssetDownloader.Intance().AddURL(getCommonURL());
        //AssetDownloader.Intance().AddURL(getCustomURL());
        AssetDownloader.Instance().Start();
    }
Exemplo n.º 21
0
 public void Update()
 {
     if (m_bDownloading)
     {
         lock (AssetDownloader.Instance().m_lockWeb)
         {
             if (AssetDownloader.Instance().m_bFinished)
             {
                 m_bDownloading = false;
                 m_comEnvChecker.LocalVerCheck();
             }
             else
             {
                 m_comEnvChecker.DownloadProcess(AssetDownloader.Instance().m_qwLoaded, AssetDownloader.Instance().m_qwTotal);
             }
         }
     }
 }
Exemplo n.º 22
0
        public static bool SettingAssets(string version, string version_ex)
        {
            bool flag = false;

            if (!string.IsNullOrEmpty(version))
            {
                if (Network.AssetVersion != version)
                {
                    flag = true;
                }
                string dlHost = Network.DLHost;
                Network.AssetVersion         = version;
                Network.AssetVersionEx       = version_ex;
                AssetDownloader.DownloadURL  = dlHost + "/assets/" + version + "/";
                AssetDownloader.StreamingURL = dlHost + "/";
                AssetDownloader.SetBaseDownloadURL(dlHost + "/assets/");
                AssetDownloader.ExDownloadURL = !string.IsNullOrEmpty(version_ex) ? dlHost + "/assets_ex/" + version_ex + "/" : dlHost + "/assets/demo_ex/";
            }
            return(flag);
        }
Exemplo n.º 23
0
        /// <summary>
        /// Starts our downloads, starting with our asset list from a specified URL
        /// </summary>
        public static void DownloadAssets(string locationUrl, string manifestList)
        {
            //Find our state
            GetState();

            //Set our form
            GetForm();

            if (downloader == null)
            {
                downloader = new AssetDownloader();
            }

            //Get or set our current working directory
            if (!string.IsNullOrWhiteSpace(CurrentDirectory))
            {
                downloader.CurrentDirectory = CurrentDirectory;
            }
            else
            {
                downloader.CurrentDirectory = Directory.GetCurrentDirectory();
            }


            //Set our url location
            downloader.CurrentUrl = locationUrl;

            downloader.OnUpdateComplete += DontSkipUpdates; //When launcher files are done downloading

            downloader.OnAssetDownloadBegin           += OnDownloadBegin;
            downloader.OnAssetDownloadProgressChanged += OnDownloadProgressChanged;
            downloader.OnAssetDownloadCompleted       += OnDownloadCompleted;

            downloader.OnMd5ChecksumProgress  += UpdateMsgAndProgressBar;
            downloader.OnMd5ChecksumCompleted += UpdateComplete;

            //Start our downloads
            UpdateMessage("Fetching manifest file...");
            downloader.DownloadAssetList(manifestList);
        }
Exemplo n.º 24
0
        public static void SettingAssets(string version, string version_ex)
        {
            if (string.IsNullOrEmpty(version))
            {
                return;
            }
            string dlHost = Network.DLHost;

            Network.AssetVersion         = version;
            Network.AssetVersionEx       = version_ex;
            AssetDownloader.DownloadURL  = dlHost + "assets/" + version + "/";
            AssetDownloader.StreamingURL = dlHost + string.Empty;
            AssetDownloader.SetBaseDownloadURL(dlHost + "assets/");
            if (string.IsNullOrEmpty(version_ex))
            {
                AssetDownloader.ExDownloadURL = dlHost + "assets/demo_ex/";
            }
            else
            {
                AssetDownloader.ExDownloadURL = dlHost + "assets_ex/" + version_ex + "/";
            }
        }
        /// <summary>
        /// Creates a new AssetDownloadController, which monitors the updating of the game every time
        /// the launcher is started.
        /// </summary>
        /// <param name="baseUrlDirectory">The URL of the asset repository directory</param>
        public AssetDownloadController(string baseUrlDirectory)
        {
            if (baseUrlDirectory == null)
            {
                throw new ArgumentNullException("baseUrlDirectory");
            }

            downloadList = new List <AssetDownloader.AssetDescriptor>();

            numFilesDownloaded = 0;
            numTotalDownloads  = 0;

            form.FormClosing += OnUpdaterFormClosing;

            assetDownloader = new AssetDownloader(baseUrlDirectory);

            assetDownloader.OnAssetFileListDownloadProgressChanged += OnAssetFileListDownloadProgressChanged;
            assetDownloader.OnAssetFileListDownloadCompleted       += OnAssetFileListDownloadCompleted;

            assetDownloader.OnAssetDownloadBegin           += OnAssetDownloadBegin;
            assetDownloader.OnAssetDownloadProgressChanged += OnAssetDownloadProgressChanged;
            assetDownloader.OnAssetDownloadCompleted       += OnAssetDownloadCompleted;
        }
        public void AssetDownloader_FailsWhenInitializedToInvalidPath()
        {
            AssetDownloader assetDownloader = new AssetDownloader("", null, null);

            Assert.Fail();
        }
Exemplo n.º 27
0
 /// <summary>
 /// Pings the server, checking for activity
 /// </summary>
 private static bool PingServer(string Url)
 {
     IStatus.PingRequestStatusCode ping = AssetDownloader.PingAccount(Url);
     return(ping == IStatus.PingRequestStatusCode.Ok ? true : false);
 }
Exemplo n.º 28
0
 private void Awake()
 {
     instance = this;
     Debug.unityLogger.logEnabled = false;
 }
        public void AssetDownloader_GeneratesCorrectFileLocation()
        {
            AssetDownloader assetDownloader = new AssetDownloader(Path.GetTempPath(), null, (string cardId) => $"{cardId}.jpg");

            Assert.AreEqual(Path.Combine(Path.GetTempPath(), "testFile.jpg"), assetDownloader.StoragePathFor("testFile"));
        }
Exemplo n.º 30
0
        private void AddAssets()
        {
            GameManager instanceDirect = MonoSingleton <GameManager> .GetInstanceDirect();

            if (this.mQueue != null)
            {
                for (int index = 0; index < this.mQueue.Count; ++index)
                {
                    AssetDownloader.Add(this.mQueue[index].IDStr);
                }
                this.mQueue = (List <AssetList.Item>)null;
            }
            if (this.Download == (FlowNode_DownloadAssets.DownloadAssets) - 1)
            {
                return;
            }
            if ((this.Download & FlowNode_DownloadAssets.DownloadAssets.Tutorial) != (FlowNode_DownloadAssets.DownloadAssets) 0)
            {
                if ((instanceDirect.Player.TutorialFlags & 1L) != 0L)
                {
                    if (instanceDirect.HasTutorialDLAssets)
                    {
                        instanceDirect.DownloadTutorialAssets();
                    }
                    AssetManager.PrepareAssets("town001");
                }
                else if (BackgroundDownloader.Instance.IsEnabled)
                {
                    this.ProgressBar = false;
                    this.ActivateOutputLinks(10);
                    BackgroundDownloader.Instance.GetRequiredAssets(GameSettings.Instance.Tutorial_Steps[instanceDirect.TutorialStep]);
                }
                else
                {
                    if (instanceDirect.HasTutorialDLAssets)
                    {
                        instanceDirect.DownloadTutorialAssets();
                    }
                    if (!GameUtility.IsDebugBuild || GlobalVars.DebugIsPlayTutorial)
                    {
                        AssetManager.PrepareAssets("PortraitsM/urob");
                        AssetManager.PrepareAssets("op0002exit");
                        AssetManager.PrepareAssets("op0005exit");
                        AssetManager.PrepareAssets("op0006exit");
                    }
                    AssetManager.PrepareAssets("town001");
                    AssetManager.PrepareAssets("UI/QuestAssets");
                }
            }
            if ((this.Download & FlowNode_DownloadAssets.DownloadAssets.OwnUnits) != (FlowNode_DownloadAssets.DownloadAssets) 0 && ((instanceDirect.Player.TutorialFlags & 1L) != 0L || !BackgroundDownloader.Instance.IsEnabled))
            {
                PlayerData player = MonoSingleton <GameManager> .Instance.Player;
                if (player != null)
                {
                    for (int index = 0; index < player.Units.Count; ++index)
                    {
                        DownloadUtility.DownloadUnit(player.Units[index].UnitParam, player.Units[index].Jobs);
                    }
                }
            }
            if ((this.Download & FlowNode_DownloadAssets.DownloadAssets.AllUnits) != (FlowNode_DownloadAssets.DownloadAssets) 0)
            {
                MasterParam masterParam    = MonoSingleton <GameManager> .Instance.MasterParam;
                UnitParam[] unitParamArray = masterParam != null?masterParam.GetAllUnits() : (UnitParam[])null;

                if (unitParamArray != null)
                {
                    for (int index = 0; index < unitParamArray.Length; ++index)
                    {
                        DownloadUtility.DownloadUnit(unitParamArray[index], (JobData[])null);
                    }
                }
            }
            if ((this.Download & FlowNode_DownloadAssets.DownloadAssets.LoginBonus) != (FlowNode_DownloadAssets.DownloadAssets) 0 && ((instanceDirect.Player.TutorialFlags & 1L) != 0L || !BackgroundDownloader.Instance.IsEnabled))
            {
                Json_LoginBonusTable loginBonus28days = MonoSingleton <GameManager> .Instance.Player.LoginBonus28days;
                if (loginBonus28days != null && loginBonus28days.bonus_units != null && loginBonus28days.bonus_units.Length > 0)
                {
                    MasterParam masterParam = MonoSingleton <GameManager> .Instance.MasterParam;
                    foreach (string bonusUnit in loginBonus28days.bonus_units)
                    {
                        DownloadUtility.DownloadUnit(masterParam.GetUnitParam(bonusUnit), (JobData[])null);
                    }
                }
            }
            if ((this.Download & FlowNode_DownloadAssets.DownloadAssets.Artifacts) != (FlowNode_DownloadAssets.DownloadAssets) 0)
            {
                List <ArtifactData> artifacts = MonoSingleton <GameManager> .Instance.Player.Artifacts;
                if (artifacts != null && artifacts.Count > 0)
                {
                    for (int index = 0; index < artifacts.Count; ++index)
                    {
                        DownloadUtility.DownloadArtifact(artifacts[index].ArtifactParam);
                    }
                }
            }
            for (int index = 0; index < this.AssetPaths.Length; ++index)
            {
                if (!string.IsNullOrEmpty(this.AssetPaths[index]))
                {
                    AssetManager.PrepareAssets(this.AssetPaths[index]);
                }
            }
            if (!Object.op_Inequality((Object)instanceDirect, (Object)null))
            {
                return;
            }
            for (int index = 0; index < this.DownloadUnits.Length; ++index)
            {
                if (!string.IsNullOrEmpty(this.DownloadUnits[index]))
                {
                    UnitParam unitParam = instanceDirect.GetUnitParam(this.DownloadUnits[index]);
                    if (unitParam != null)
                    {
                        DownloadUtility.DownloadUnit(unitParam, (JobData[])null);
                    }
                }
            }
            for (int index = 0; index < this.DownloadQuests.Length; ++index)
            {
                if (!string.IsNullOrEmpty(this.DownloadQuests[index]))
                {
                    QuestParam quest = instanceDirect.FindQuest(this.DownloadQuests[index]);
                    if (quest == null)
                    {
                        DebugUtility.LogError("Can't download " + this.DownloadQuests[index]);
                    }
                    else
                    {
                        DownloadUtility.DownloadQuestBase(quest);
                    }
                }
            }
        }