Esempio n. 1
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);
                    }
                }
            }
        }
Esempio n. 2
0
    public static void DownloadUnit(Unit unit, bool dlStatusEffects = false)
    {
        UnitParam     unitParam    = unit.UnitParam;
        JobParam      job          = unit.Job == null ? (JobParam)null : unit.Job.Param;
        ArtifactParam selectedSkin = unit.UnitData.GetSelectedSkin(-1);

        CharacterDB.Job characterData = DownloadUtility.GetCharacterData(unitParam, job, selectedSkin);
        if (characterData == null)
        {
            return;
        }
        DownloadUtility.PrepareUnitAssets(characterData, job);
        if (unit.Job != null)
        {
            DownloadUtility.PrepareJobAssets(unit.Job.Param);
        }
        string jobName = unit.UnitData.CurrentJob == null ? string.Empty : unit.UnitData.CurrentJob.JobID;

        AssetManager.PrepareAssets(AssetPath.UnitSkinIconSmall(unitParam, selectedSkin, jobName));
        AssetManager.PrepareAssets(AssetPath.UnitSkinIconMedium(unitParam, selectedSkin, jobName));
        AssetManager.PrepareAssets(AssetPath.UnitSkinEyeImage(unitParam, selectedSkin, jobName));
        SkillData attackSkill = unit.GetAttackSkill();

        if (attackSkill != null)
        {
            DownloadUtility.PrepareSkillAssets(characterData, attackSkill.SkillParam);
        }
        for (int index = unit.BattleSkills.Count - 1; index >= 0; --index)
        {
            DownloadUtility.PrepareSkillAssets(characterData, unit.BattleSkills[index].SkillParam);
        }
        for (int index = unit.BattleAbilitys.Count - 1; index >= 0; --index)
        {
            AbilityData battleAbility = unit.BattleAbilitys[index];
            if (battleAbility != null && battleAbility.Param != null)
            {
                AssetManager.PrepareAssets(AssetPath.AbilityIcon(battleAbility.Param));
            }
        }
        if (unit != null)
        {
            DownloadUtility.PrepareUnitVoice(unit.UnitParam);
        }
        if (dlStatusEffects)
        {
            for (int index = 0; index < BadStatusEffects.Effects.Count; ++index)
            {
                if (!string.IsNullOrEmpty(BadStatusEffects.Effects[index].AnimationName))
                {
                    DownloadUtility.PrepareUnitAnimation(characterData, BadStatusEffects.Effects[index].AnimationName, false, (JobParam)null);
                }
            }
        }
        JobData[] jobs = unit.UnitData.Jobs;
        int       artifactSlotIndex = JobData.GetArtifactSlotIndex(ArtifactTypes.Arms);

        if (jobs != null)
        {
            List <ArtifactParam> artifacts = MonoSingleton <GameManager> .GetInstanceDirect().MasterParam.Artifacts;

            foreach (JobData jobData in jobs)
            {
                if (jobData != null)
                {
                    // ISSUE: object of a compiler-generated type is created
                    // ISSUE: reference to a compiler-generated method
                    ArtifactParam artifalct = artifacts.Find(new Predicate <ArtifactParam>(new DownloadUtility.\u003CDownloadUnit\u003Ec__AnonStorey1F2()
                    {
                        uniqId = (string)null, uniqId = jobData.ArtifactDatas[artifactSlotIndex] == null ? jobData.Param.artifact : jobData.ArtifactDatas[artifactSlotIndex].ArtifactParam.iname
                    }.\u003C\u003Em__1B8));
                    if (artifalct != null)
                    {
                        DownloadUtility.DownloadArtifact(artifalct);
                    }
                }
            }
        }
        else
        {
            if (unit.Job == null)
            {
                return;
            }
            DownloadUtility.DownloadArtifact(MonoSingleton <GameManager> .GetInstanceDirect().MasterParam.GetArtifactParam(unit.Job.Param.artifact));
        }
    }
        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 && instanceDirect.HasTutorialDLAssets)
            {
                instanceDirect.DownloadTutorialAssets();
            }
            if ((this.Download & FlowNode_DownloadAssets.DownloadAssets.OwnUnits) != (FlowNode_DownloadAssets.DownloadAssets) 0)
            {
                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 (player.Units[index].ConceptCard != null)
                        {
                            DownloadUtility.DownloadConceptCard(player.Units[index].ConceptCard.Param);
                        }
                    }
                }
            }
            if ((this.Download & FlowNode_DownloadAssets.DownloadAssets.AllUnits) != (FlowNode_DownloadAssets.DownloadAssets) 0)
            {
                UnitParam[] allUnits = MonoSingleton <GameManager> .Instance.MasterParam?.GetAllUnits();

                if (allUnits != null)
                {
                    for (int index = 0; index < allUnits.Length; ++index)
                    {
                        DownloadUtility.DownloadUnit(allUnits[index], (JobData[])null);
                    }
                }
            }
            if ((this.Download & FlowNode_DownloadAssets.DownloadAssets.LoginBonus) != (FlowNode_DownloadAssets.DownloadAssets) 0)
            {
                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);
                    }
                }
            }
            if ((this.Download & FlowNode_DownloadAssets.DownloadAssets.OwnConceptCard) != (FlowNode_DownloadAssets.DownloadAssets) 0)
            {
                List <ConceptCardData> conceptCards = MonoSingleton <GameManager> .Instance.Player.ConceptCards;
                if (conceptCards != null && conceptCards.Count > 0)
                {
                    for (int index = 0; index < conceptCards.Count; ++index)
                    {
                        DownloadUtility.DownloadConceptCard(conceptCards[index].Param);
                    }
                }
                List <ConceptCardMaterialData> cardExpMaterials = MonoSingleton <GameManager> .Instance.Player.ConceptCardExpMaterials;
                if (cardExpMaterials != null && cardExpMaterials.Count > 0)
                {
                    for (int index = 0; index < cardExpMaterials.Count; ++index)
                    {
                        DownloadUtility.DownloadConceptCard(cardExpMaterials[index].Param);
                    }
                }
                List <ConceptCardMaterialData> cardTrustMaterials = MonoSingleton <GameManager> .Instance.Player.ConceptCardTrustMaterials;
                if (cardTrustMaterials != null && cardTrustMaterials.Count > 0)
                {
                    for (int index = 0; index < cardTrustMaterials.Count; ++index)
                    {
                        DownloadUtility.DownloadConceptCard(cardTrustMaterials[index].Param);
                    }
                }
            }
            for (int index = 0; index < this.AssetPaths.Length; ++index)
            {
                if (!string.IsNullOrEmpty(this.AssetPaths[index]))
                {
                    AssetManager.PrepareAssets(this.AssetPaths[index]);
                }
            }
            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)instanceDirect, (UnityEngine.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);
                    }
                }
            }
        }
Esempio n. 4
0
    public static void DownloadUnit(UnitParam unit, JobData[] jobs = null)
    {
        // ISSUE: object of a compiler-generated type is created
        // ISSUE: variable of a compiler-generated type
        DownloadUtility.\u003CDownloadUnit\u003Ec__AnonStorey1ED unitCAnonStorey1Ed = new DownloadUtility.\u003CDownloadUnit\u003Ec__AnonStorey1ED();
        // ISSUE: reference to a compiler-generated field
        unitCAnonStorey1Ed.unit = unit;
        // ISSUE: reference to a compiler-generated field
        if (unitCAnonStorey1Ed.unit == null)
        {
            return;
        }
        // ISSUE: reference to a compiler-generated field
        CharacterDB.Character character = CharacterDB.FindCharacter(unitCAnonStorey1Ed.unit.model);
        if (character == null)
        {
            return;
        }
        GameManager instance = MonoSingleton <GameManager> .Instance;

        // ISSUE: reference to a compiler-generated field
        if (unitCAnonStorey1Ed.unit.jobsets != null)
        {
            // ISSUE: reference to a compiler-generated field
            for (int index = 0; index < unitCAnonStorey1Ed.unit.jobsets.Length; ++index)
            {
                // ISSUE: reference to a compiler-generated field
                for (JobSetParam jobSetParam = instance.GetJobSetParam((string)unitCAnonStorey1Ed.unit.jobsets[index]); jobSetParam != null; jobSetParam = string.IsNullOrEmpty(jobSetParam.jobchange) ? (JobSetParam)null : instance.GetJobSetParam(jobSetParam.jobchange))
                {
                    JobParam jobParam = instance.GetJobParam(jobSetParam.job);
                    // ISSUE: reference to a compiler-generated field
                    SkillParam skillParam = string.IsNullOrEmpty(jobParam.atkskill[0]) ? instance.MasterParam.GetSkillParam(jobParam.atkskill[(int)unitCAnonStorey1Ed.unit.element]) : instance.MasterParam.GetSkillParam(jobParam.atkskill[0]);
                    if (skillParam != null)
                    {
                        SkillSequence sequence = SkillSequence.FindSequence(skillParam.motion);
                        if (sequence != null && !string.IsNullOrEmpty(sequence.SkillAnimation.Name) && index < character.Jobs.Count)
                        {
                            DownloadUtility.PrepareUnitAnimation(character.Jobs[index], sequence.SkillAnimation.Name, false, (JobParam)null);
                        }
                    }
                    DownloadUtility.DownloadJobEquipment(jobParam);
                    ArtifactParam artifactParam = MonoSingleton <GameManager> .GetInstanceDirect().MasterParam.GetArtifactParam(jobParam.artifact);

                    if (artifactParam != null)
                    {
                        DownloadUtility.DownloadArtifact(artifactParam);
                    }
                    int artifactSlotIndex = JobData.GetArtifactSlotIndex(ArtifactTypes.Arms);
                    if (jobs != null)
                    {
                        foreach (JobData job in jobs)
                        {
                            if (job != null)
                            {
                                // ISSUE: object of a compiler-generated type is created
                                // ISSUE: variable of a compiler-generated type
                                DownloadUtility.\u003CDownloadUnit\u003Ec__AnonStorey1EC unitCAnonStorey1Ec = new DownloadUtility.\u003CDownloadUnit\u003Ec__AnonStorey1EC();
                                List <ArtifactData> artifacts = MonoSingleton <GameManager> .GetInstanceDirect().Player.Artifacts;

                                // ISSUE: reference to a compiler-generated field
                                unitCAnonStorey1Ec.uniqId = job.Artifacts[artifactSlotIndex];
                                // ISSUE: reference to a compiler-generated method
                                ArtifactData artifactData = artifacts.Find(new Predicate <ArtifactData>(unitCAnonStorey1Ec.\u003C\u003Em__1B4));
                                if (artifactData != null)
                                {
                                    DownloadUtility.DownloadArtifact(artifactData.ArtifactParam);
                                }
                            }
                        }
                    }
                    else
                    {
                        DownloadUtility.DownloadArtifact(instance.MasterParam.GetArtifactParam(jobParam.artifact));
                    }
                    // ISSUE: reference to a compiler-generated field
                    AssetManager.PrepareAssets(AssetPath.UnitImage(unitCAnonStorey1Ed.unit, jobSetParam.job));
                    // ISSUE: reference to a compiler-generated field
                    AssetManager.PrepareAssets(AssetPath.UnitImage2(unitCAnonStorey1Ed.unit, jobSetParam.job));
                    // ISSUE: reference to a compiler-generated field
                    AssetManager.PrepareAssets(AssetPath.UnitIconSmall(unitCAnonStorey1Ed.unit, jobSetParam.job));
                    // ISSUE: reference to a compiler-generated field
                    AssetManager.PrepareAssets(AssetPath.UnitIconMedium(unitCAnonStorey1Ed.unit, jobSetParam.job));
                    // ISSUE: reference to a compiler-generated field
                    AssetManager.PrepareAssets(AssetPath.UnitEyeImage(unitCAnonStorey1Ed.unit, jobSetParam.job));
                }
            }
            // ISSUE: reference to a compiler-generated field
            JobSetParam[] changeJobSetParam = instance.GetClassChangeJobSetParam(unitCAnonStorey1Ed.unit.iname);
            if (changeJobSetParam != null && changeJobSetParam.Length > 0)
            {
                for (int index = 0; index < changeJobSetParam.Length; ++index)
                {
                    JobSetParam jobSetParam = changeJobSetParam[index];
                    if (jobSetParam != null)
                    {
                        JobParam      jobParam      = instance.GetJobParam(jobSetParam.job);
                        ArtifactParam artifactParam = MonoSingleton <GameManager> .GetInstanceDirect().MasterParam.GetArtifactParam(jobParam.artifact);

                        if (artifactParam != null)
                        {
                            DownloadUtility.DownloadArtifact(artifactParam);
                        }
                        // ISSUE: reference to a compiler-generated field
                        SkillParam skillParam = string.IsNullOrEmpty(jobParam.atkskill[0]) ? instance.MasterParam.GetSkillParam(jobParam.atkskill[(int)unitCAnonStorey1Ed.unit.element]) : instance.MasterParam.GetSkillParam(jobParam.atkskill[0]);
                        if (skillParam != null)
                        {
                            SkillSequence sequence = SkillSequence.FindSequence(skillParam.motion);
                            if (sequence != null && !string.IsNullOrEmpty(sequence.SkillAnimation.Name))
                            {
                                DownloadUtility.PrepareUnitAnimation(character.Jobs[index], sequence.SkillAnimation.Name, false, (JobParam)null);
                            }
                        }
                    }
                }
            }
        }
        for (int index = 0; index < character.Jobs.Count; ++index)
        {
            CharacterDB.Job job = character.Jobs[index];
            DownloadUtility.PrepareUnitModels(job);
            DownloadUtility.PrepareUnitAnimation(job, "unit_info_idle0", true, (JobParam)null);
            DownloadUtility.PrepareUnitAnimation(job, "unit_info_act0", true, (JobParam)null);
        }
        // ISSUE: reference to a compiler-generated field
        AssetManager.PrepareAssets("CHM/Home_" + unitCAnonStorey1Ed.unit.model + "_walk0");
        // ISSUE: reference to a compiler-generated field
        if (unitCAnonStorey1Ed.unit.skins != null)
        {
            List <ArtifactParam> artifacts = MonoSingleton <GameManager> .GetInstanceDirect().MasterParam.Artifacts;

            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            DownloadUtility.\u003CDownloadUnit\u003Ec__AnonStorey1EE unitCAnonStorey1Ee = new DownloadUtility.\u003CDownloadUnit\u003Ec__AnonStorey1EE();
            // ISSUE: reference to a compiler-generated field
            unitCAnonStorey1Ee.\u003C\u003Ef__ref\u0024493 = unitCAnonStorey1Ed;
            // ISSUE: reference to a compiler-generated field
            // ISSUE: reference to a compiler-generated field
            // ISSUE: reference to a compiler-generated field
            // ISSUE: reference to a compiler-generated field
            for (unitCAnonStorey1Ee.i = 0; unitCAnonStorey1Ee.i < unitCAnonStorey1Ed.unit.skins.Length; ++unitCAnonStorey1Ee.i)
            {
                // ISSUE: reference to a compiler-generated method
                ArtifactParam skin = artifacts.Find(new Predicate <ArtifactParam>(unitCAnonStorey1Ee.\u003C\u003Em__1B5));
                if (skin != null)
                {
                    // ISSUE: reference to a compiler-generated field
                    AssetManager.PrepareAssets(AssetPath.UnitSkinImage(unitCAnonStorey1Ed.unit, skin, (string)null));
                    // ISSUE: reference to a compiler-generated field
                    AssetManager.PrepareAssets(AssetPath.UnitSkinImage2(unitCAnonStorey1Ed.unit, skin, (string)null));
                    // ISSUE: reference to a compiler-generated field
                    AssetManager.PrepareAssets(AssetPath.UnitSkinIconSmall(unitCAnonStorey1Ed.unit, skin, (string)null));
                    // ISSUE: reference to a compiler-generated field
                    AssetManager.PrepareAssets(AssetPath.UnitSkinIconMedium(unitCAnonStorey1Ed.unit, skin, (string)null));
                    // ISSUE: reference to a compiler-generated field
                    AssetManager.PrepareAssets(AssetPath.UnitSkinEyeImage(unitCAnonStorey1Ed.unit, skin, (string)null));
                }
            }
        }
        // ISSUE: reference to a compiler-generated field
        DownloadUtility.PrepareUnitVoice(unitCAnonStorey1Ed.unit);
    }