Exemplo n.º 1
0
        protected override IEnumerator Load()
        {
            m_modifications = new WeaponAndDeckModifications();
            m_modifications.Setup();
            this.LoadAssetBundle(AssetBundlesUtility.GetUIAnimatedCharacterResourcesBundleName());
            this.LoadAssetBundle("core/ui/characters/companions");
            string bundleName = AssetBundlesUtility.GetUICharacterResourcesBundleName();
            AssetBundleLoadRequest bundleLoadRequest = AssetManager.LoadAssetBundle(bundleName);

            while (!bundleLoadRequest.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(bundleLoadRequest.get_error()) != 0)
            {
                Log.Error($"Error while loading bundle '{bundleName}' error={bundleLoadRequest.get_error()}", 48, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\States\\PlayerUI\\DeckMainState.cs");
                yield break;
            }
            UILoader <DeckUIRoot> loader = new UILoader <DeckUIRoot>(this, "PlayerLayer_DeckCanvas", "core/scenes/ui/deck", disableOnLoad: true);

            yield return(loader.Load());

            m_ui = loader.ui;
            yield return(m_ui.LoadAssets());

            m_ui.get_gameObject().SetActive(true);
            m_ui.Initialise(m_modifications);
        }
Exemplo n.º 2
0
    public IEnumerator Load()
    {
        if (bundle == null)
        {
            if (loadRequest == null)
            {
                foreach (var bundle in depends)
                {
                    bundle.Load();
                }
                loadRequest = AssetLoader.Instance.Load(nameHash, path);
            }

            if (loadRequest != null)
            {
                yield return(loadRequest);

                bundle      = loadRequest.bundle;
                loadRequest = null;
            }

            foreach (var bundle in depends)
            {
                if (bundle is PackageBundle pakBundle && pakBundle.loadRequest != null)
                {
                    yield return(pakBundle.loadRequest);
                }
            }
        }
    }
Exemplo n.º 3
0
        private IEnumerator Load(string guid, string bundleName, UIResourceDisplayMode displayMode)
        {
            loadState = UIResourceLoadState.Loading;
            AssetBundleLoadRequest bundleLoadRequest = AssetManager.LoadAssetBundle(bundleName);

            while (!bundleLoadRequest.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(bundleLoadRequest.get_error()) != 0)
            {
                loadState           = UIResourceLoadState.Error;
                m_pendingBundleName = string.Empty;
                if (m_resourceConsumer != null)
                {
                    m_resourceConsumer.UnRegister(this);
                    m_resourceConsumer = null;
                }
                Log.Error($"Could not load bundle named '{bundleName}': {bundleLoadRequest.get_error()}", 226, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\UI\\Components\\UIResourceLoader.cs");
                m_coroutine = null;
                yield break;
            }
            AssetLoadRequest <T> assetLoadRequest = AssetManager.LoadAssetAsync <T>(guid, bundleName);

            while (!assetLoadRequest.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(assetLoadRequest.get_error()) != 0)
            {
                AssetManager.UnloadAssetBundle(bundleName);
                loadState           = UIResourceLoadState.Error;
                m_pendingBundleName = string.Empty;
                if (m_resourceConsumer != null)
                {
                    m_resourceConsumer.UnRegister(this);
                    m_resourceConsumer = null;
                }
                Log.Error($"Could not load asset with guid {guid} from bundle named '{bundleName}': {assetLoadRequest.get_error()}", 253, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\UI\\Components\\UIResourceLoader.cs");
                m_coroutine = null;
                yield break;
            }
            T asset = assetLoadRequest.get_asset();

            yield return(Apply(asset, displayMode));

            if (m_loadedBundleName.Length != 0)
            {
                AssetManager.UnloadAssetBundle(m_loadedBundleName);
            }
            loadState           = UIResourceLoadState.Loaded;
            m_pendingBundleName = string.Empty;
            m_loadedBundleName  = bundleName;
            if (m_resourceConsumer != null)
            {
                m_resourceConsumer.UnRegister(this);
                m_resourceConsumer = null;
            }
            m_coroutine = null;
        }
Exemplo n.º 4
0
        public IEnumerator LoadSceneAndBundleRequest(string sceneName, string bundleName, LoadSceneMode mode = 1, Action <SceneLoadRequest> completed = null)
        {
            //IL_001c: Unknown result type (might be due to invalid IL or missing references)
            //IL_001d: Unknown result type (might be due to invalid IL or missing references)
            AssetBundleLoadRequest bundleLoadRequest = this.LoadAssetBundle(bundleName);

            while (!bundleLoadRequest.get_isDone())
            {
                yield return(null);
            }
            AssetManagerError error;

            if (AssetManagerError.op_Implicit(bundleLoadRequest.get_error()) != 0)
            {
                error = bundleLoadRequest.get_error();
                Log.Error(((object)error).ToString(), 112, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\States\\LoadSceneStateContext.cs");
                yield break;
            }
            LoadSceneParameters val = default(LoadSceneParameters);

            val._002Ector(mode);
            SceneLoadRequest sceneLoadRequest = this.LoadScene(sceneName, bundleName, val, true, completed);

            while (!sceneLoadRequest.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(sceneLoadRequest.get_error()) != 0)
            {
                error = sceneLoadRequest.get_error();
                Log.Error(((object)error).ToString(), 126, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\States\\LoadSceneStateContext.cs");
            }
        }
Exemplo n.º 5
0
        protected override IEnumerator Load()
        {
            string bundleName = AssetBundlesUtility.GetUICharacterResourcesBundleName();
            AssetBundleLoadRequest bundleLoadRequest = AssetManager.LoadAssetBundle(bundleName);

            while (!bundleLoadRequest.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(bundleLoadRequest.get_error()) != 0)
            {
                Log.Error($"Error while loading bundle '{bundleName}' error={bundleLoadRequest.get_error()}", 26, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\States\\PlayerUI\\PlayerUIMainState.cs");
                yield break;
            }
            UILoader <PlayerIconRoot> loader = new UILoader <PlayerIconRoot>(this, "PlayerLayerUI", "core/scenes/ui/player", disableOnLoad: true);

            yield return(loader.Load());

            m_ui = loader.ui;
            yield return(m_ui.LoadAssets());

            m_ui.get_gameObject().SetActive(true);
            m_ui.Initialise(this);
            m_ui.LoadVisual();
        }
Exemplo n.º 6
0
        public static IEnumerator LoadIllustrationAsync <T>(this EditableData definition, string bundleName, AssetReference assetReference, Action <T, string> onLoaded) where T : Object
        {
            //IL_0015: Unknown result type (might be due to invalid IL or missing references)
            //IL_0016: Unknown result type (might be due to invalid IL or missing references)
            AssetBundleLoadRequest bundleLoadRequest = AssetManager.LoadAssetBundle(bundleName);

            while (!bundleLoadRequest.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(bundleLoadRequest.get_error()) != 0)
            {
                Log.Error($"Error while loading bundle '{bundleName}' for {((object)definition).GetType().Name} {definition.get_name()} error={bundleLoadRequest.get_error()}", 36, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Data\\Definitions\\ICastableDefinition.cs");
                onLoaded?.Invoke(default(T), null);
                yield break;
            }
            AssetLoadRequest <T> assetLoadRequest = assetReference.LoadFromAssetBundleAsync <T>(bundleName);

            while (!assetLoadRequest.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(assetLoadRequest.get_error()) != 0)
            {
                Log.Error($"Error while loading illustration for {((object)definition).GetType().Name} {definition.get_name()} error={assetLoadRequest.get_error()}", 50, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Data\\Definitions\\ICastableDefinition.cs");
                onLoaded?.Invoke(default(T), bundleName);
            }
            else
            {
                onLoaded?.Invoke(assetLoadRequest.get_asset(), bundleName);
            }
        }
Exemplo n.º 7
0
    private IEnumerator LoadAssetBundle(int id, AssetBundleLoadRequest request)
    {
#if !UNITY_EDITOR && UNITY_ANDROID
        request.WebLoad = true;
#endif
        string hotPatchPath = ResFileUtil.FindHotPathFilePath(request.path);
        if (hotPatchPath != null)
        {
            request.path    = hotPatchPath;
            request.WebLoad = false;
        }
        else
        {
            if (request.WebLoad)
            {
                request.path = ResPathUtil.GetStreamAssetFileUrl(request.path, false);
            }
            else
            {
                request.path = ResPathUtil.GetStreamAssetFilePath(request.path);
            }
        }
        if (request.WebLoad)
        {
            yield return(LoadByWebRequest(request));
        }
        else
        {
            yield return(LoadByFile(request));
        }
        request.LoadFinish = true;
        loadingRequests.Remove(id);
    }
Exemplo n.º 8
0
        public void LoadAllFromAsset <T>(string bundle, AssetLoadedCallback callback)
        {
            AssetBundleLoadRequest loadRequest = new AssetBundleLoadRequest();

            loadRequest.callback = callback;
            loadRequest.request  = mLoadedAssets[bundle].bundle.LoadAllAssetsAsync <T>();
            mPendingAssetBundleRequests.Add(loadRequest);
        }
Exemplo n.º 9
0
        public IEnumerator ChangeAnimatedCharacterData(int skinId, Gender gender)
        {
            if (!RuntimeData.characterSkinDefinitions.TryGetValue(skinId, out CharacterSkinDefinition characterSkinDefinition))
            {
                Log.Error($"Could not find character skin definition with id {skinId}.", 211, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Maps\\Objects\\CharacterObject.cs");
                yield break;
            }
            BundleCategory         bundleCategory    = characterSkinDefinition.bundleCategory;
            string                 bundleName        = AssetBundlesUtility.GetAnimatedCharacterDataBundle(bundleCategory);
            AssetBundleLoadRequest bundleLoadRequest = AssetManager.LoadAssetBundle(bundleName);

            m_activeCharacterDataBundleCategory = bundleCategory;
            while (!bundleLoadRequest.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(bundleLoadRequest.get_error()) != 0)
            {
                Log.Error($"Failed to load asset bundle named '{bundleName}' for character skin {characterSkinDefinition.get_displayName()} ({characterSkinDefinition.get_id()}): {bundleLoadRequest.get_error()}", 230, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Maps\\Objects\\CharacterObject.cs");
                yield break;
            }
            AssetReference animatedCharacterDataReference = characterSkinDefinition.GetAnimatedCharacterDataReference(gender);
            AssetLoadRequest <AnimatedCharacterData> animatedCharacterDataLoadRequest = animatedCharacterDataReference.LoadFromAssetBundleAsync <AnimatedCharacterData>(bundleName);

            while (!animatedCharacterDataLoadRequest.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(animatedCharacterDataLoadRequest.get_error()) != 0)
            {
                AssetManager.UnloadAssetBundle(bundleName);
                m_activeCharacterDataBundleCategory = BundleCategory.None;
                Log.Error(string.Format("Failed to load requested {0} asset from bundle '{1}' for character skin {2} ({3}): {4}", "AnimatedCharacterData", bundleName, characterSkinDefinition.get_displayName(), characterSkinDefinition.get_id(), animatedCharacterDataLoadRequest.get_error()), 247, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Maps\\Objects\\CharacterObject.cs");
                yield break;
            }
            AnimatedCharacterData newAnimatedCharacterData = animatedCharacterDataLoadRequest.get_asset();

            yield return(newAnimatedCharacterData.LoadTimelineResources());

            AnimatedCharacterData animatedCharacterData = GetAnimatedCharacterData();

            if (null != animatedCharacterData)
            {
                string animatedCharacterDataBundle = AssetBundlesUtility.GetAnimatedCharacterDataBundle(m_animatedCharacterDataBundleCategory);
                animatedCharacterData.UnloadTimelineResources();
                AssetManager.UnloadAssetBundle(animatedCharacterDataBundle);
                m_animatedCharacterDataBundleCategory = BundleCategory.None;
            }
            SetAnimatedCharacterData(newAnimatedCharacterData);
            m_animatedCharacterDataBundleCategory = m_activeCharacterDataBundleCategory;
            m_activeCharacterDataBundleCategory   = BundleCategory.None;
            IAnimator2D animator       = GetAnimator();
            int         animationFrame = animator.get_currentFrame();

            yield return(SetAnimatorDefinition());

            animator.set_currentFrame(animationFrame);
        }
Exemplo n.º 10
0
    private IEnumerator LoadByFile(AssetBundleLoadRequest request)
    {
        var abcr = AssetBundle.LoadFromFileAsync(request.path);

        yield return(abcr);

        request.bundle = abcr.assetBundle;
        if (request.bundle == null)
        {
            Debug.LogError("AssetBundle 加载失败 => " + request.path);
        }
    }
Exemplo n.º 11
0
        public IEnumerator LoadResources()
        {
            if (!m_prefabReference.get_hasValue())
            {
                yield break;
            }
            GameObject asset;

            if (string.IsNullOrEmpty(m_assetBundleName))
            {
                AssetReferenceRequest <GameObject> assetReferenceRequest2 = m_prefabReference.LoadFromResourcesAsync <GameObject>();
                while (!assetReferenceRequest2.get_isDone())
                {
                    yield return(null);
                }
                asset = assetReferenceRequest2.get_asset();
            }
            else
            {
                AssetBundleLoadRequest bundleRequest = AssetManager.LoadAssetBundle(m_assetBundleName);
                while (!bundleRequest.get_isDone())
                {
                    yield return(null);
                }
                if (AssetManagerError.op_Implicit(bundleRequest.get_error()) != 0)
                {
                    Log.Error($"Could not load bundle named '{m_assetBundleName}': {bundleRequest.get_error()}", 99, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Animations\\VisualEffectPlayableAsset.cs");
                    yield break;
                }
                m_loadedAssetBundle = true;
                AssetLoadRequest <GameObject> assetReferenceRequest = m_prefabReference.LoadFromAssetBundleAsync <GameObject>(m_assetBundleName);
                while (!assetReferenceRequest.get_isDone())
                {
                    yield return(null);
                }
                if (AssetManagerError.op_Implicit(assetReferenceRequest.get_error()) != 0)
                {
                    Log.Error($"Could not load requested asset ({m_prefabReference.get_value()}) from bundle named '{m_assetBundleName}': {assetReferenceRequest.get_error()}", 113, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Animations\\VisualEffectPlayableAsset.cs");
                    yield break;
                }
                asset = assetReferenceRequest.get_asset();
            }
            VisualEffect component = asset.GetComponent <VisualEffect>();

            if (null == component)
            {
                Log.Error("Could not use prefab because it doesn't have a VisualEffect component.", 123, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Animations\\VisualEffectPlayableAsset.cs");
                yield break;
            }
            VisualEffectFactory.PreparePool(asset);
            m_prefab = component;
        }
Exemplo n.º 12
0
        private IEnumerator LoadCharacterSkin()
        {
            if (!string.IsNullOrEmpty(m_lastLoadedCharacterBundle))
            {
                this.UnloadAssetBundle(m_lastLoadedCharacterBundle, true, true);
                m_lastLoadedCharacterBundle = null;
            }
            PlayerData instance = PlayerData.instance;
            Gender     gender   = instance.gender;
            Id <CharacterSkinDefinition> skin = instance.Skin;

            if (skin == null || !RuntimeData.characterSkinDefinitions.TryGetValue(skin.value, out CharacterSkinDefinition characterSkinDefinition))
            {
                yield break;
            }
            BundleCategory         bundleCategory    = characterSkinDefinition.bundleCategory;
            string                 bundleName        = m_lastLoadedCharacterBundle = AssetBundlesUtility.GetAnimatedCharacterDataBundle(bundleCategory);
            AssetBundleLoadRequest bundleLoadRequest = this.LoadAssetBundle(bundleName);

            while (!bundleLoadRequest.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(bundleLoadRequest.get_error()) != 0)
            {
                Log.Error($"Failed to load asset bundle named '{bundleName}' for character skin {characterSkinDefinition.get_displayName()} ({characterSkinDefinition.get_id()}): {bundleLoadRequest.get_error()}", 253, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\States\\HavreDimension\\HavreDimensionMainState.cs");
                yield break;
            }
            AssetReference animatedCharacterDataReference = characterSkinDefinition.GetAnimatedCharacterDataReference(gender);
            AssetLoadRequest <AnimatedCharacterData> animatedCharacterDataLoadRequest = animatedCharacterDataReference.LoadFromAssetBundleAsync <AnimatedCharacterData>(bundleName);

            while (!animatedCharacterDataLoadRequest.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(animatedCharacterDataLoadRequest.get_error()) != 0)
            {
                this.UnloadAssetBundle(bundleName, true, true);
                Log.Error(string.Format("Failed to load {0} asset from bundle '{1}' for character skin {2} ({3}): {4}", "AnimatedCharacterData", bundleName, characterSkinDefinition.get_displayName(), characterSkinDefinition.get_id(), animatedCharacterDataLoadRequest.get_error()), 269, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\States\\HavreDimension\\HavreDimensionMainState.cs");
                yield break;
            }
            AnimatedCharacterData animatedCharacterData = animatedCharacterDataLoadRequest.get_asset();

            yield return(animatedCharacterData.LoadTimelineResources());

            AnimatedFightCharacterData animatedFightCharacterData = animatedCharacterData as AnimatedFightCharacterData;
            AnimatedObjectDefinition   animatedObjectDefinition   = animatedFightCharacterData.animatedObjectDefinition;

            m_havreMap.character.SetCharacterData(animatedFightCharacterData, animatedObjectDefinition);
            m_loadCharacterCoroutine = null;
        }
Exemplo n.º 13
0
 public AudioBankLoadRequest(string bankName, AssetReference assetReference, string bundleName, bool loadSamples)
     : this()
 {
     //IL_0002: Unknown result type (might be due to invalid IL or missing references)
     //IL_0007: Unknown result type (might be due to invalid IL or missing references)
     //IL_0029: Unknown result type (might be due to invalid IL or missing references)
     //IL_002a: Unknown result type (might be due to invalid IL or missing references)
     this.bankName       = bankName;
     this.bundleName     = bundleName;
     this.loadSamples    = loadSamples;
     m_assetReference    = assetReference;
     m_bundleLoadRequest = AssetManager.LoadAssetBundle(bundleName);
     isDone = Update();
 }
Exemplo n.º 14
0
        protected IEnumerator LoadBundleRequest(string bundleName)
        {
            AssetBundleLoadRequest bundleLoadRequest = this.LoadAssetBundle(bundleName);

            while (!bundleLoadRequest.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(bundleLoadRequest.get_error()) != 0)
            {
                AssetManagerError error = bundleLoadRequest.get_error();
                Log.Error(((object)error).ToString(), 97, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\States\\LoadSceneStateContext.cs");
            }
        }
Exemplo n.º 15
0
    private IEnumerator LoadByWebRequest(AssetBundleLoadRequest request)
    {
        UnityWebRequest download = UnityWebRequestAssetBundle.GetAssetBundle(request.path, CacheVersion, 0);

        request.webRequest = download;
        yield return(download.SendWebRequest());

        if (download.result == UnityWebRequest.Result.Success)
        {
            request.bundle = DownloadHandlerAssetBundle.GetContent(download);
        }
        request.webRequest = null;
        if (request.bundle == null)
        {
            Debug.LogError("AssetBundle 加载失败 => " + request.path);
        }
    }
Exemplo n.º 16
0
 public void Cancel()
 {
     //IL_0026: Unknown result type (might be due to invalid IL or missing references)
     //IL_002b: Unknown result type (might be due to invalid IL or missing references)
     //IL_0030: Unknown result type (might be due to invalid IL or missing references)
     //IL_0040: Unknown result type (might be due to invalid IL or missing references)
     //IL_0045: Unknown result type (might be due to invalid IL or missing references)
     //IL_0048: Unknown result type (might be due to invalid IL or missing references)
     //IL_004e: Unknown result type (might be due to invalid IL or missing references)
     //IL_0050: Invalid comparison between Unknown and I4
     //IL_0052: Unknown result type (might be due to invalid IL or missing references)
     //IL_0054: Invalid comparison between Unknown and I4
     //IL_0057: Unknown result type (might be due to invalid IL or missing references)
     //IL_005c: Unknown result type (might be due to invalid IL or missing references)
     //IL_005f: Unknown result type (might be due to invalid IL or missing references)
     //IL_0066: Unknown result type (might be due to invalid IL or missing references)
     //IL_006b: Unknown result type (might be due to invalid IL or missing references)
     //IL_0076: Unknown result type (might be due to invalid IL or missing references)
     if (m_bundleLoadRequest != null)
     {
         AssetManager.UnloadAssetBundle(bundleName);
         m_bundleLoadRequest = null;
     }
     else if (m_assetLoadRequest == null)
     {
         Bank          bank = this.bank;
         LOADING_STATE val  = default(LOADING_STATE);
         if ((int)bank.getLoadingState(ref val) == 0)
         {
             if (m_loadingSamples)
             {
                 bank = this.bank;
                 bank.unloadSampleData();
             }
             if ((int)val == 2 || (int)val == 3)
             {
                 bank = this.bank;
                 bank.unload();
                 bank = this.bank;
                 bank.clearHandle();
             }
         }
     }
     error  = AssetManagerError.op_Implicit(50);
     isDone = true;
 }
Exemplo n.º 17
0
 public AssetBundleLoadRequest Load(int hasId, string path)
 {
     if (loadingRequests.TryGetValue(hasId, out var request))
     {
         return(request);
     }
     request = new AssetBundleLoadRequest
     {
         path = path
     };
     loadingRequests.Add(hasId, request);
     waits.Enqueue(hasId);
     if (loadCoroutineCount < QueueMaxCount)
     {
         StartCoroutine(DoLoad());
     }
     return(request);
 }
Exemplo n.º 18
0
        private IEnumerator PreloadSceneAssetBundleAsync(string assetBundleName, string sceneName, LoadSceneMode loadSceneMode, Action <float> progressCallback)
        {
            int startFrameCount = Time.frameCount;

            m_cacheAssetBundleLoadRequest = AssetBundleManager.Instance.LoadSceneAsync(assetBundleName, sceneName, loadSceneMode);
            if (null == m_cacheAssetBundleLoadRequest)
            {
                yield break;
            }

            while (!m_cacheAssetBundleLoadRequest.IsDone())
            {
                progressCallback?.Invoke(m_cacheAssetBundleLoadRequest.GetProgress());
                yield return(null);
            }

            progressCallback?.Invoke(m_cacheAssetBundleLoadRequest.GetProgress());
            JSLDebug.LogFormat(LOG_LOAD_SCENE_SUCCEED, sceneName, startFrameCount, Time.frameCount);
        }
Exemplo n.º 19
0
        private IEnumerator LoadGod()
        {
            if (!string.IsNullOrEmpty(m_lastLoadedGodBundle))
            {
                this.UnloadAssetBundle(m_lastLoadedGodBundle, true, true);
                m_lastLoadedGodBundle = null;
            }
            God god = PlayerData.instance.god;

            if (!RuntimeData.godDefinitions.TryGetValue(god, out GodDefinition value))
            {
                yield break;
            }
            AssetReference         statuePrefabReference = value.statuePrefabReference;
            string                 bundleName            = m_lastLoadedGodBundle = AssetBundlesUtility.GetUIGodsResourcesBundleName();
            AssetBundleLoadRequest bundleRequest         = this.LoadAssetBundle(bundleName);

            while (!bundleRequest.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(bundleRequest.get_error()) != 0)
            {
                Log.Error($"Could not load bundle named '{bundleName}': {bundleRequest.get_error()}", 196, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\States\\HavreDimension\\HavreDimensionMainState.cs");
                yield break;
            }
            AssetLoadRequest <GameObject> assetReferenceRequest = statuePrefabReference.LoadFromAssetBundleAsync <GameObject>(bundleName);

            while (!assetReferenceRequest.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(assetReferenceRequest.get_error()) != 0)
            {
                Log.Error($"Could not load requested asset ({statuePrefabReference.get_value()}) from bundle named '{bundleName}': {assetReferenceRequest.get_error()}", 208, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\States\\HavreDimension\\HavreDimensionMainState.cs");
                yield break;
            }
            GameObject asset = assetReferenceRequest.get_asset();

            m_havreMap.godZaap.SetStatue(asset);
            m_loadGodCoroutine = null;
        }
Exemplo n.º 20
0
 public static IEnumerator CheckPatch()
 {
     foreach (CachedAssetBundle item in AssetManager.EnumerateCachedAssetBundles())
     {
         CachedAssetBundle current = item;
         if (!Caching.IsVersionCached(current))
         {
             string assetBundleName             = current.get_name();
             AssetBundleLoadRequest loadRequest = AssetManager.LoadAssetBundle(assetBundleName);
             while (!loadRequest.get_isDone())
             {
                 yield return(null);
             }
             AssetBundleUnloadRequest unloadRequest = AssetManager.UnloadAssetBundle(assetBundleName);
             while (!unloadRequest.get_isDone())
             {
                 yield return(null);
             }
         }
     }
 }
Exemplo n.º 21
0
        public static IEnumerator Load()
        {
            if (isReady)
            {
                Log.Error("Load called while the fight object factory is already ready.", 61, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\FightObjectFactory.cs");
                yield break;
            }
            AssetBundleLoadRequest bundleRequest = AssetManager.LoadAssetBundle("core/factories/fight_object_factory");

            while (!bundleRequest.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(bundleRequest.get_error()) != 0)
            {
                Log.Error(string.Format("Error while loading bundle: {0} error={1}", "core/factories/fight_object_factory", bundleRequest.get_error()), 74, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\FightObjectFactory.cs");
                yield break;
            }
            AllAssetsLoadRequest <FightObjectFactory> assetLoadRequest = AssetManager.LoadAllAssetsAsync <FightObjectFactory>("core/factories/fight_object_factory");

            while (!assetLoadRequest.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(assetLoadRequest.get_error()) != 0)
            {
                Log.Error(string.Format("Error while loading asset: {0} error={1}", "FightObjectFactory", assetLoadRequest.get_error()), 85, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\FightObjectFactory.cs");
                yield break;
            }
            s_instance = assetLoadRequest.get_assets()[0];
            s_companionCharacterPool       = new GameObjectPool(s_instance.m_companionCharacterPrefab, 2);
            s_summoningCharacterPool       = new GameObjectPool(s_instance.m_summoningCharacterPrefab, 2);
            s_objectMechanismCharacterPool = new GameObjectPool(s_instance.m_objectMechanismPrefab, 2);
            s_floorMechanismCharacterPool  = new GameObjectPool(s_instance.m_floorMechanismPrefab, 2);
            s_animatedObjectEffectPool     = new GameObjectPool(s_instance.m_animatedObjectEffectPrefab, 2);
            s_timelineAssetEffectPool      = new GameObjectPool(s_instance.m_timelineAssetEffectPrefab, 4);
            s_valueChangedFeedbackPool     = new GameObjectPool(s_instance.m_valueChangedFeedbackPrefab, 4);
            isReady = true;
        }
        public static IEnumerator Load(int fightCount)
        {
            if (isReady)
            {
                Log.Error("Load called while the fight object factory is already ready.", 91, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\FightSpellEffectFactory.cs");
                yield break;
            }
            AssetBundleLoadRequest bundleRequest = AssetManager.LoadAssetBundle("core/spells/effects");

            while (!bundleRequest.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(bundleRequest.get_error()) != 0)
            {
                Log.Error(string.Format("Error while loading bundle '{0}': {1}", "core/spells/effects", bundleRequest.get_error()), 103, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\FightSpellEffectFactory.cs");
                yield break;
            }
            AllAssetsLoadRequest <FightSpellEffectFactory> assetLoadRequest = AssetManager.LoadAllAssetsAsync <FightSpellEffectFactory>("core/spells/effects");

            while (!assetLoadRequest.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(assetLoadRequest.get_error()) != 0)
            {
                Log.Error(string.Format("Error while loading asset {0}: {1}", "FightSpellEffectFactory", assetLoadRequest.get_error()), 115, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\FightSpellEffectFactory.cs");
                yield break;
            }
            s_instance = assetLoadRequest.get_assets()[0];
            SpellEffectReferenceDictionary           genericSpellEffects = s_instance.m_genericSpellEffects;
            Dictionary <SpellEffectKey, SpellEffect> spellEffectCache    = s_spellEffectCache = new Dictionary <SpellEffectKey, SpellEffect>(((Dictionary <SpellEffectKey, AssetReference>)genericSpellEffects).Count, SpellEffectKeyComparer.instance);

            yield return(PreloadEffectAssets(genericSpellEffects, spellEffectCache, "core/spells/effects"));

            yield return(LoadEffectsResources(spellEffectCache));

            PropertyEffectReferenceDictionary         propertyEffects     = s_instance.m_propertyEffects;
            Dictionary <PropertyId, AttachableEffect> propertyEffectCache = s_propertyEffectCache = new Dictionary <PropertyId, AttachableEffect>(((Dictionary <PropertyId, AssetReference>)propertyEffects).Count, PropertyIdComparer.instance);

            yield return(PreloadEffectAssets(propertyEffects, propertyEffectCache, "core/spells/effects"));

            yield return(LoadEffectsResources(propertyEffectCache));

            SightEffectReferenceDictionary sightEffects = s_instance.m_sightEffects;
            Dictionary <PropertyId, FloatingCounterEffect> sightEffectCache = s_sightEffectCache = new Dictionary <PropertyId, FloatingCounterEffect>(((Dictionary <PropertyId, AssetReference>)sightEffects).Count, PropertyIdComparer.instance);

            yield return(PreloadEffectAssets(sightEffects, sightEffectCache, "core/spells/effects"));

            yield return(LoadEffectsResources(sightEffectCache));

            FloatingCounterEffectReferenceDictionary    floatingCounterEffects     = s_instance.m_floatingCounterEffects;
            Dictionary <CaracId, FloatingCounterEffect> floatingCounterEffectCache = s_floatingCounterEffectCache = new Dictionary <CaracId, FloatingCounterEffect>(((Dictionary <CaracId, AssetReference>)floatingCounterEffects).Count, CaracIdComparer.instance);

            yield return(PreloadEffectAssets(floatingCounterEffects, floatingCounterEffectCache, "core/spells/effects"));

            yield return(LoadEffectsResources(floatingCounterEffectCache));

            s_floatingCounterFeedbackPool    = new GameObjectPool(s_instance.m_floatingCounterFeedbackPrefab.get_gameObject());
            s_loadedSpellDefinitions         = new List <SpellDefinition>(24);
            s_currentSpellEffectOverrideData = new SpellEffectOverrideData[fightCount];
            isReady = true;
        }
Exemplo n.º 23
0
        private bool Update()
        {
            //IL_001b: Unknown result type (might be due to invalid IL or missing references)
            //IL_002e: Unknown result type (might be due to invalid IL or missing references)
            //IL_0077: Unknown result type (might be due to invalid IL or missing references)
            //IL_008a: Unknown result type (might be due to invalid IL or missing references)
            //IL_00a9: Unknown result type (might be due to invalid IL or missing references)
            //IL_00ae: Unknown result type (might be due to invalid IL or missing references)
            //IL_00bb: Unknown result type (might be due to invalid IL or missing references)
            //IL_00c2: Unknown result type (might be due to invalid IL or missing references)
            //IL_00cd: Unknown result type (might be due to invalid IL or missing references)
            //IL_00d2: Unknown result type (might be due to invalid IL or missing references)
            //IL_00d8: Unknown result type (might be due to invalid IL or missing references)
            //IL_00dd: Unknown result type (might be due to invalid IL or missing references)
            //IL_00de: Unknown result type (might be due to invalid IL or missing references)
            //IL_00f2: Unknown result type (might be due to invalid IL or missing references)
            //IL_010c: Unknown result type (might be due to invalid IL or missing references)
            //IL_0117: Unknown result type (might be due to invalid IL or missing references)
            //IL_011c: Unknown result type (might be due to invalid IL or missing references)
            //IL_0120: Unknown result type (might be due to invalid IL or missing references)
            //IL_0127: Unknown result type (might be due to invalid IL or missing references)
            //IL_012c: Unknown result type (might be due to invalid IL or missing references)
            //IL_0137: Unknown result type (might be due to invalid IL or missing references)
            //IL_0151: Expected I4, but got Unknown
            //IL_017d: Unknown result type (might be due to invalid IL or missing references)
            //IL_019f: Unknown result type (might be due to invalid IL or missing references)
            //IL_01a4: Unknown result type (might be due to invalid IL or missing references)
            //IL_01a8: Unknown result type (might be due to invalid IL or missing references)
            //IL_01dd: Unknown result type (might be due to invalid IL or missing references)
            //IL_01e2: Unknown result type (might be due to invalid IL or missing references)
            //IL_01e8: Unknown result type (might be due to invalid IL or missing references)
            //IL_01ef: Unknown result type (might be due to invalid IL or missing references)
            //IL_01f2: Unknown result type (might be due to invalid IL or missing references)
            //IL_0204: Expected I4, but got Unknown
            //IL_022d: Unknown result type (might be due to invalid IL or missing references)
            //IL_0232: Unknown result type (might be due to invalid IL or missing references)
            //IL_0236: Unknown result type (might be due to invalid IL or missing references)
            //IL_0292: Unknown result type (might be due to invalid IL or missing references)
            //IL_029d: Unknown result type (might be due to invalid IL or missing references)
            //IL_02a2: Unknown result type (might be due to invalid IL or missing references)
            //IL_02a6: Unknown result type (might be due to invalid IL or missing references)
            //IL_02ad: Unknown result type (might be due to invalid IL or missing references)
            //IL_02b2: Unknown result type (might be due to invalid IL or missing references)
            if (m_bundleLoadRequest != null)
            {
                if (!m_bundleLoadRequest.get_isDone())
                {
                    return(false);
                }
                if (AssetManagerError.op_Implicit(m_bundleLoadRequest.get_error()) != 0)
                {
                    error = m_bundleLoadRequest.get_error();
                    return(true);
                }
                m_bundleLoadRequest = null;
                m_assetLoadRequest  = m_assetReference.LoadFromAssetBundleAsync <TextAsset>(bundleName);
            }
            if (m_assetLoadRequest != null)
            {
                if (!m_assetLoadRequest.get_isDone())
                {
                    return(false);
                }
                if (AssetManagerError.op_Implicit(m_assetLoadRequest.get_error()) != 0)
                {
                    error = m_assetLoadRequest.get_error();
                    return(true);
                }
                TextAsset asset = m_assetLoadRequest.get_asset();
                m_assetLoadRequest = null;
                System studioSystem = AudioManager.studioSystem;
                Bank   bank         = default(Bank);
                studioSystem.loadBankMemoryPoint(asset.get_bytes(), 1, ref bank);
                this.bank = bank;
            }
            Bank          bank2        = this.bank;
            LOADING_STATE val          = default(LOADING_STATE);
            RESULT        loadingState = bank2.getLoadingState(ref val);

            if ((int)loadingState != 0)
            {
                Log.Error($"Failed to retrieve loading state for bank named '{bankName}' loaded from bundle named '{bundleName}': {loadingState}.", 121, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Audio\\AudioBankLoadRequest.cs");
                error = AssetManagerError.op_Implicit(30);
                bank2 = this.bank;
                bank2.unload();
                bank2 = this.bank;
                bank2.clearHandle();
                return(true);
            }
            switch ((int)val)
            {
            case 0:
            case 1:
                Log.Error("Bank named '" + bankName + "' is being either unloaded or being unloaded instead of being loaded.", 132, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Audio\\AudioBankLoadRequest.cs");
                error = AssetManagerError.op_Implicit(30);
                return(true);

            case 2:
                return(false);

            case 3:
                if (loadSamples)
                {
                    if (!m_loadingSamples)
                    {
                        bank2 = this.bank;
                        if ((int)bank2.loadSampleData() != 0)
                        {
                            Log.Warning("Could not load samples for bank named '" + bankName + "'.", 147, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Audio\\AudioBankLoadRequest.cs");
                            return(true);
                        }
                        m_loadingSamples = true;
                    }
                    bank2 = this.bank;
                    LOADING_STATE val2 = default(LOADING_STATE);
                    if ((int)bank2.getSampleLoadingState(ref val2) == 0)
                    {
                        switch (val2 - 2)
                        {
                        case 0:
                            return(false);

                        case 2:
                            Log.Error("Failed to load samples for bank named '" + bankName + "'.", 165, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Audio\\AudioBankLoadRequest.cs");
                            bank2 = this.bank;
                            bank2.unloadSampleData();
                            break;
                        }
                    }
                    else
                    {
                        Log.Warning("Could not get sample loading state for bank named '" + bankName + "'.", 172, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Audio\\AudioBankLoadRequest.cs");
                    }
                    m_loadingSamples = false;
                }
                return(true);

            case 4:
                Log.Error("Failed to load bank named '" + bankName + "'.", 180, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Audio\\AudioBankLoadRequest.cs");
                error = AssetManagerError.op_Implicit(30);
                bank2 = this.bank;
                bank2.unload();
                bank2 = this.bank;
                bank2.clearHandle();
                return(true);

            default:
                throw new ArgumentOutOfRangeException();
            }
        }