Пример #1
0
        public string GetJobId(int jobIndex)
        {
            JobSetParam jobSetFast = this.GetJobSetFast(jobIndex);

            if (jobSetFast != null)
            {
                return(jobSetFast.job);
            }
            return(string.Empty);
        }
Пример #2
0
        private bool CheckUnlockJob(int jobno, int awake_lv)
        {
            if (awake_lv == 0 || this.mCurrentUnit.CheckJobUnlockable(jobno))
            {
                return(false);
            }
            JobSetParam jobSetParam = this.mCurrentUnit.GetJobSetParam(jobno);

            return(jobSetParam != null && jobSetParam.lock_awakelv != 0 && jobSetParam.lock_awakelv <= awake_lv);
        }
Пример #3
0
        private UnitData CreateUnitData(UnitParam uparam)
        {
            UnitData  unitData = new UnitData();
            Json_Unit json     = new Json_Unit()
            {
                iid    = 1,
                iname  = uparam.iname,
                exp    = 0,
                lv     = 1,
                plus   = 0,
                rare   = 0,
                select = new Json_UnitSelectable(),
                jobs   = (Json_Job[])null,
                abil   = (Json_MasterAbility)null
            };

            json.abil = (Json_MasterAbility)null;
            if (uparam.jobsets != null && uparam.jobsets.Length > 0)
            {
                List <Json_Job> jsonJobList = new List <Json_Job>(uparam.jobsets.Length);
                int             num         = 1;
                for (int index = 0; index < uparam.jobsets.Length; ++index)
                {
                    JobSetParam jobSetParam = MonoSingleton <GameManager> .Instance.GetJobSetParam(uparam.jobsets[index]);

                    if (jobSetParam != null)
                    {
                        jsonJobList.Add(new Json_Job()
                        {
                            iid    = (long)num++,
                            iname  = jobSetParam.job,
                            rank   = 0,
                            equips = (Json_Equip[])null,
                            abils  = (Json_Ability[])null
                        });
                    }
                }
                json.jobs = jsonJobList.ToArray();
            }
            unitData.Deserialize(json);
            unitData.SetUniqueID(1L);
            unitData.JobRankUp(0);
            return(unitData);
        }
Пример #4
0
        public static UnitData CreateUnitData(UnitParam param)
        {
            UnitData  unitData = new UnitData();
            Json_Unit json     = new Json_Unit();

            json.iid        = 1L;
            json.iname      = param.iname;
            json.exp        = 0;
            json.lv         = 1;
            json.plus       = 0;
            json.rare       = (int)param.rare;
            json.select     = new Json_UnitSelectable();
            json.select.job = 0L;
            json.jobs       = (Json_Job[])null;
            json.abil       = (Json_MasterAbility)null;
            if (param.jobsets != null && param.jobsets.Length > 0)
            {
                List <Json_Job> jsonJobList = new List <Json_Job>(param.jobsets.Length);
                int             num         = 1;
                for (int index = 0; index < param.jobsets.Length; ++index)
                {
                    JobSetParam jobSetParam = MonoSingleton <GameManager> .GetInstanceDirect().GetJobSetParam((string)param.jobsets[index]);

                    if (jobSetParam != null)
                    {
                        jsonJobList.Add(new Json_Job()
                        {
                            iid    = (long)num++,
                            iname  = jobSetParam.job,
                            rank   = 0,
                            equips = (Json_Equip[])null,
                            abils  = (Json_Ability[])null
                        });
                    }
                }
                json.jobs = jsonJobList.ToArray();
            }
            unitData.Deserialize(json);
            unitData.SetUniqueID(1L);
            unitData.JobRankUp(0);
            return(unitData);
        }
Пример #5
0
        public void Refresh(UnitParam param, string shard_name = "", int awake_lv = 0, int get_shard = 0, int current_index = 0)
        {
            if (param == null)
            {
                return;
            }
            GameManager instance1 = MonoSingleton <GameManager> .Instance;

            this.InitRebirthStar();
            this.rebirthstar_template.SetActive(false);
            this.mNotUnlockUnit = true;
            this.mget_shard     = get_shard;
            this.msub_shard     = this.GetPastShard(current_index, (string)param.piece);
            this.muse_shard     = 0;
            this.mstart_gauge   = 0;
            this.mremain_shard  = this.mget_shard;
            UnitData unitDataByUnitId = instance1.Player.FindUnitDataByUnitID(param.iname);

            this.mCurrentUnitIname = param.iname;
            string path1 = AssetPath.UnitImage(param, param.GetJobId(0));

            instance1.ApplyTextureAsync(this.unit_img, path1);
            instance1.ApplyTextureAsync(this.unit_img_blur01, path1);
            instance1.ApplyTextureAsync(this.unit_img_blur02, path1);
            string path2 = AssetPath.UnitIconSmall(param, param.GetJobId(0));

            instance1.ApplyTextureAsync((RawImage)this.unit_icon, path2);
            GameSettings instance2 = GameSettings.Instance;

            if (unitDataByUnitId != null && EElement.None <= unitDataByUnitId.Element && unitDataByUnitId.Element < (EElement)instance2.Elements_IconSmall.Length)
            {
                this.element_icon.set_sprite(instance2.Elements_IconSmall[(int)unitDataByUnitId.Element]);
            }
            else
            {
                this.element_icon.set_sprite((Sprite)null);
            }
            this.ShardName.set_text(shard_name);
            this.StartAwakeLv = this.NowAwakeLv = awake_lv;
            if (unitDataByUnitId != null)
            {
                this.mNotUnlockUnit = false;
                this.AwakeLvCap     = unitDataByUnitId.GetAwakeLevelCap();
                int num1 = (int)instance1.MasterParam.GetRarityParam(unitDataByUnitId.Rarity).UnitAwakeLvCap / 5;
                for (int index = 0; index < num1; ++index)
                {
                    GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.rebirthstar_template);
                    gameObject.get_transform().SetParent(this.rebirthstar_root.get_transform(), false);
                    gameObject.SetActive(true);
                    this.mRebirthStars.Add(gameObject);
                }
                int index1 = this.StartAwakeLv / 5;
                for (int index2 = 0; index2 < index1 && this.mRebirthStars.Count >= index2; ++index2)
                {
                    Transform child = this.mRebirthStars[index2].get_transform().FindChild("Rebirth_star_anim");
                    ((Component)child.FindChild("Rebirthstar_01")).get_gameObject().SetActive(true);
                    ((Component)child.FindChild("Rebirthstar_02")).get_gameObject().SetActive(true);
                    ((Component)child.FindChild("Rebirthstar_03")).get_gameObject().SetActive(true);
                    ((Component)child.FindChild("Rebirthstar_04")).get_gameObject().SetActive(true);
                    ((Component)child.FindChild("Rebirthstar_05")).get_gameObject().SetActive(true);
                }
                int num2 = this.StartAwakeLv % 5;
                if (num2 > 0)
                {
                    Transform child = this.mRebirthStars[index1].get_transform().FindChild("Rebirth_star_anim");
                    for (int index2 = 0; index2 < num2; ++index2)
                    {
                        string str = "Rebirthstar_0" + (object)(index2 + 1);
                        ((Component)child.FindChild(str)).get_gameObject().SetActive(true);
                    }
                }
                if (this.msub_shard > 0)
                {
                    int startAwakeLv    = this.StartAwakeLv;
                    int msubShard       = this.msub_shard;
                    int awakeNeedPieces = instance1.MasterParam.GetAwakeNeedPieces(startAwakeLv);
                    int num3            = this.AwakeLvCap / 5;
                    while (msubShard >= awakeNeedPieces)
                    {
                        int       num4  = startAwakeLv / 5;
                        int       num5  = Math.Min(5, startAwakeLv % 5) + 1;
                        Transform child = this.mRebirthStars[num4 + 1 < num3 ? num4 : num3 - 1].get_transform().FindChild("Rebirth_star_anim").FindChild("Rebirthstar_0" + num5.ToString());
                        if (Object.op_Inequality((Object)child, (Object)null))
                        {
                            ((Component)child).get_gameObject().SetActive(true);
                        }
                        ++startAwakeLv;
                        if (startAwakeLv < this.AwakeLvCap)
                        {
                            msubShard      -= awakeNeedPieces;
                            awakeNeedPieces = instance1.MasterParam.GetAwakeNeedPieces(startAwakeLv);
                            if (msubShard < awakeNeedPieces)
                            {
                                break;
                            }
                        }
                        else
                        {
                            break;
                        }
                    }
                    if (Object.op_Inequality((Object)this.ShardNext, (Object)null))
                    {
                        this.ShardNext.set_text(awakeNeedPieces.ToString());
                    }
                    if (Object.op_Inequality((Object)this.ShardCurrent, (Object)null))
                    {
                        this.ShardCurrent.set_text(msubShard.ToString());
                    }
                    this.mstart_gauge = msubShard;
                    this.ShardGauge.AnimateValue((float)msubShard / (float)awakeNeedPieces, 0.0f);
                    this.StartAwakeLv = startAwakeLv;
                    this.NowAwakeLv   = this.StartAwakeLv;
                    this.NextAwakeLv  = this.StartAwakeLv + 1 <= this.AwakeLvCap ? this.StartAwakeLv + 1 : this.AwakeLvCap;
                }
            }
            int num = unitDataByUnitId == null?param.GetUnlockNeedPieces() : instance1.MasterParam.GetAwakeNeedPieces(this.StartAwakeLv);

            this.mnext_shard = num;
            this.muse_shard  = this.mget_shard >= num ? num : this.mget_shard;
            if (this.mstart_gauge > 0 && this.mstart_gauge + this.muse_shard > this.mnext_shard)
            {
                this.muse_shard -= this.mstart_gauge;
            }
            this.mremain_shard -= this.muse_shard;
            if (unitDataByUnitId == null && this.muse_shard >= this.mnext_shard)
            {
                this.mUnlockUnit = true;
            }
            if (this.muse_shard >= this.mnext_shard && this.msub_shard <= 0)
            {
                this.NextAwakeLv = this.NowAwakeLv + 1 <= this.AwakeLvCap ? this.NowAwakeLv + 1 : this.AwakeLvCap;
            }
            if (param.jobsets != null && param.jobsets.Length > 0)
            {
                this.mJobID      = new List <string>();
                this.mJobAwakeLv = new List <int>();
                for (int index = 0; index < param.jobsets.Length; ++index)
                {
                    JobSetParam jobSetParam = MonoSingleton <GameManager> .Instance.GetJobSetParam((string)param.jobsets[index]);

                    if (jobSetParam != null && jobSetParam.lock_awakelv > 0 && (unitDataByUnitId == null || !unitDataByUnitId.Jobs[index].IsActivated) && this.StartAwakeLv < jobSetParam.lock_awakelv)
                    {
                        this.mJobID.Add(jobSetParam.job);
                        this.mJobAwakeLv.Add(jobSetParam.lock_awakelv);
                    }
                }
                if (this.mJobID != null && this.mJobID.Count > 1)
                {
                    JobParam jobParam = MonoSingleton <GameManager> .Instance.GetJobParam(this.mJobID[0]);

                    this.JobName.set_text(jobParam.name);
                    this.JobComment.set_text(LocalizedText.Get("sys.GACHA_TEXT_SHARD_AWAKE", new object[1]
                    {
                        (object)jobParam.name
                    }));
                }
            }
            this.isRunningAnimator = true;
        }
        public string GetCondText(UnitParam unit)
        {
            if (unit == null)
            {
                return(string.Empty);
            }
            string str1 = string.Empty;
            string str2 = string.Empty;
            string str3 = string.Empty;

            if (this.type == QuestClearUnlockUnitDataParam.EUnlockTypes.Ability || this.type == QuestClearUnlockUnitDataParam.EUnlockTypes.Skill)
            {
                OString[] jobsets = unit.jobsets;
                if (jobsets != null)
                {
                    MasterParam masterParam   = MonoSingleton <GameManager> .Instance.MasterParam;
                    JobParam[]  jobParamArray = new JobParam[jobsets.Length];
                    for (int index = 0; index < jobsets.Length; ++index)
                    {
                        JobSetParam jobSetParam = masterParam.GetJobSetParam((string)jobsets[index]);
                        if (jobSetParam != null)
                        {
                            jobParamArray[index] = MonoSingleton <GameManager> .Instance.MasterParam.GetJobParam(jobSetParam.job);
                        }
                    }
                    if (this.type == QuestClearUnlockUnitDataParam.EUnlockTypes.Ability)
                    {
                        if (!this.add)
                        {
                            for (int index = 0; index < jobParamArray.Length; ++index)
                            {
                                if (jobParamArray[index].FindRankOfAbility(this.old_id) != -1)
                                {
                                    str1 = jobParamArray[index].name;
                                    break;
                                }
                            }
                        }
                    }
                    else if (this.type == QuestClearUnlockUnitDataParam.EUnlockTypes.Skill)
                    {
                        for (int index1 = 0; index1 < jobParamArray.Length; ++index1)
                        {
                            for (int lv = 0; lv < JobParam.MAX_JOB_RANK; ++lv)
                            {
                                OString[] learningAbilitys = jobParamArray[index1].GetLearningAbilitys(lv);
                                if (learningAbilitys != null && learningAbilitys.Length >= 1)
                                {
                                    for (int index2 = 0; index2 < learningAbilitys.Length; ++index2)
                                    {
                                        if (this.add)
                                        {
                                            if ((string)learningAbilitys[index2] == this.parent_id)
                                            {
                                                str1 = jobParamArray[index1].name;
                                                break;
                                            }
                                        }
                                        else
                                        {
                                            AbilityParam abilityParam = MonoSingleton <GameManager> .Instance.MasterParam.GetAbilityParam((string)learningAbilitys[index2]);

                                            if (abilityParam != null && Array.FindIndex <LearningSkill>(abilityParam.skills, (Predicate <LearningSkill>)(p => p.iname == (!this.add ? this.old_id : this.parent_id))) != -1)
                                            {
                                                str1 = jobParamArray[index1].name;
                                                break;
                                            }
                                        }
                                    }
                                    if (!string.IsNullOrEmpty(str1))
                                    {
                                        break;
                                    }
                                }
                            }
                            if (!string.IsNullOrEmpty(str1))
                            {
                                break;
                            }
                        }
                    }
                }
            }
            if (!string.IsNullOrEmpty(str1))
            {
                str1 = LocalizedText.Get("sys.PARTYEDITOR_COND_UNLOCK_TEXTFRAME", new object[1]
                {
                    (object)str1
                });
            }
            switch (this.type + 1)
            {
            case QuestClearUnlockUnitDataParam.EUnlockTypes.Ability:
            case QuestClearUnlockUnitDataParam.EUnlockTypes.MasterAbility:
                if (this.add)
                {
                    str2 = LocalizedText.Get(!string.IsNullOrEmpty(str1) ? "sys.UNITLIST_REWRITE_ABILITY" : "sys.UNITLIST_REWRITE_MASTERABILITY");
                    AbilityParam abilityParam = MonoSingleton <GameManager> .Instance.MasterParam.GetAbilityParam(this.parent_id);

                    str3 = abilityParam == null ? str3 : abilityParam.name;
                    break;
                }
                str2 = this.type != QuestClearUnlockUnitDataParam.EUnlockTypes.LeaderSkill ? LocalizedText.Get(!string.IsNullOrEmpty(str1) ? "sys.UNITLIST_REWRITE_SKILL" : "sys.UNITLIST_REWRITE_MASTERABILITY") : LocalizedText.Get("sys.UNITLIST_REWRITE_LEADERSKILL");
                SkillParam skillParam1 = MonoSingleton <GameManager> .Instance.MasterParam.GetSkillParam(this.old_id);

                str3 = skillParam1 == null ? str3 : skillParam1.name;
                break;

            case QuestClearUnlockUnitDataParam.EUnlockTypes.LeaderSkill:
                if (this.add)
                {
                    str2 = LocalizedText.Get("sys.UNITLIST_REWRITE_JOB");
                    JobParam jobParam = MonoSingleton <GameManager> .Instance.MasterParam.GetJobParam(this.parent_id);

                    str3 = jobParam == null ? str3 : jobParam.name;
                    break;
                }
                str2 = LocalizedText.Get("sys.UNITLIST_REWRITE_ABILITY");
                AbilityParam abilityParam1 = MonoSingleton <GameManager> .Instance.MasterParam.GetAbilityParam(this.old_id);

                str3 = abilityParam1 == null ? str3 : abilityParam1.name;
                break;

            case QuestClearUnlockUnitDataParam.EUnlockTypes.CollaboAbility:
                if (!this.add)
                {
                    str2 = LocalizedText.Get("sys.UNITLIST_REWRITE_MASTERABILITY");
                    AbilityParam abilityParam2 = MonoSingleton <GameManager> .Instance.MasterParam.GetAbilityParam(this.old_id);

                    if (abilityParam2 != null)
                    {
                        SkillParam skillParam2 = MonoSingleton <GameManager> .Instance.MasterParam.GetSkillParam(abilityParam2.skills[0].iname);

                        str3 = skillParam2 == null ? str3 : skillParam2.name;
                        break;
                    }
                    break;
                }
                break;
            }
            if (string.IsNullOrEmpty(str2) || string.IsNullOrEmpty(str3))
            {
                return(string.Empty);
            }
            return(LocalizedText.Get("sys.PARTYEDITOR_COND_UNLOCK_PARENT", (object)str2, (object)str1, (object)str3));
        }
Пример #7
0
        public static UnitListFilterWindow.SelectType GetFilterMask(UnitListWindow.Data data)
        {
            if (data.param == null)
            {
                return(UnitListFilterWindow.SelectType.RARITY_1 | UnitListFilterWindow.SelectType.RARITY_2 | UnitListFilterWindow.SelectType.RARITY_3 | UnitListFilterWindow.SelectType.RARITY_4 | UnitListFilterWindow.SelectType.RARITY_5 | UnitListFilterWindow.SelectType.WEAPON_SLASH | UnitListFilterWindow.SelectType.WEAPON_STAB | UnitListFilterWindow.SelectType.WEAPON_BLOW | UnitListFilterWindow.SelectType.WEAPON_SHOT | UnitListFilterWindow.SelectType.WEAPON_MAG | UnitListFilterWindow.SelectType.WEAPON_NONE | UnitListFilterWindow.SelectType.BIRTH_ENV | UnitListFilterWindow.SelectType.BIRTH_WRATH | UnitListFilterWindow.SelectType.BIRTH_SAGA | UnitListFilterWindow.SelectType.BIRTH_SLOTH | UnitListFilterWindow.SelectType.BIRTH_LUST | UnitListFilterWindow.SelectType.BIRTH_WADATSUMI | UnitListFilterWindow.SelectType.BIRTH_DESERT | UnitListFilterWindow.SelectType.BIRTH_GREED | UnitListFilterWindow.SelectType.BIRTH_GLUTTONY | UnitListFilterWindow.SelectType.BIRTH_OTHER | UnitListFilterWindow.SelectType.BIRTH_NOZ);
            }
            MasterParam masterParam = MonoSingleton <GameManager> .Instance.MasterParam;
            UnitParam   unitParam   = data.param;

            UnitListFilterWindow.SelectType selectType = UnitListFilterWindow.SelectType.NONE;
            AttackDetailTypes attackDetailTypes        = AttackDetailTypes.None;

            if (data.unit != null)
            {
                UnitData unit = data.unit;
                if (unit.CurrentJob.GetAttackSkill() != null)
                {
                    attackDetailTypes = unit.CurrentJob.GetAttackSkill().AttackDetailType;
                }
                if (unit.Rarity == 0)
                {
                    selectType |= UnitListFilterWindow.SelectType.RARITY_1;
                }
                else if (unit.Rarity == 1)
                {
                    selectType |= UnitListFilterWindow.SelectType.RARITY_2;
                }
                else if (unit.Rarity == 2)
                {
                    selectType |= UnitListFilterWindow.SelectType.RARITY_3;
                }
                else if (unit.Rarity == 3)
                {
                    selectType |= UnitListFilterWindow.SelectType.RARITY_4;
                }
                else if (unit.Rarity == 4)
                {
                    selectType |= UnitListFilterWindow.SelectType.RARITY_5;
                }
                else if (unit.Rarity == 5)
                {
                    selectType |= UnitListFilterWindow.SelectType.RARITY_6;
                }
            }
            else
            {
                if (unitParam.jobsets != null && unitParam.jobsets.Length > 0)
                {
                    JobSetParam jobSetParam = MonoSingleton <GameManager> .Instance.GetJobSetParam(unitParam.jobsets[0]);

                    if (jobSetParam != null)
                    {
                        JobParam jobParam = MonoSingleton <GameManager> .Instance.GetJobParam(jobSetParam.job);

                        if (jobParam != null && jobParam.atkskill != null && jobParam.atkskill.Length > 0)
                        {
                            string key = jobParam.atkskill[0];
                            if (!string.IsNullOrEmpty(key))
                            {
                                SkillParam skillParam = masterParam.GetSkillParam(key);
                                if (skillParam != null)
                                {
                                    attackDetailTypes = skillParam.attack_detail;
                                }
                            }
                        }
                    }
                }
                if (unitParam.rare == (byte)0)
                {
                    selectType |= UnitListFilterWindow.SelectType.RARITY_1;
                }
                else if (unitParam.rare == (byte)1)
                {
                    selectType |= UnitListFilterWindow.SelectType.RARITY_2;
                }
                else if (unitParam.rare == (byte)2)
                {
                    selectType |= UnitListFilterWindow.SelectType.RARITY_3;
                }
                else if (unitParam.rare == (byte)3)
                {
                    selectType |= UnitListFilterWindow.SelectType.RARITY_4;
                }
                else if (unitParam.rare == (byte)4)
                {
                    selectType |= UnitListFilterWindow.SelectType.RARITY_5;
                }
                else if (unitParam.rare == (byte)5)
                {
                    selectType |= UnitListFilterWindow.SelectType.RARITY_6;
                }
            }
            switch (attackDetailTypes)
            {
            case AttackDetailTypes.None:
                selectType |= UnitListFilterWindow.SelectType.WEAPON_NONE;
                break;

            case AttackDetailTypes.Slash:
                selectType |= UnitListFilterWindow.SelectType.WEAPON_SLASH;
                break;

            case AttackDetailTypes.Stab:
                selectType |= UnitListFilterWindow.SelectType.WEAPON_STAB;
                break;

            case AttackDetailTypes.Blow:
                selectType |= UnitListFilterWindow.SelectType.WEAPON_BLOW;
                break;

            case AttackDetailTypes.Shot:
                selectType |= UnitListFilterWindow.SelectType.WEAPON_SHOT;
                break;

            case AttackDetailTypes.Magic:
                selectType |= UnitListFilterWindow.SelectType.WEAPON_MAG;
                break;
            }
            if (!string.IsNullOrEmpty((string)unitParam.birth))
            {
                string birth = (string)unitParam.birth;
                if (birth == "エンヴィリア")
                {
                    selectType |= UnitListFilterWindow.SelectType.BIRTH_ENV;
                }
                else if (birth == "ラーストリス")
                {
                    selectType |= UnitListFilterWindow.SelectType.BIRTH_WRATH;
                }
                else if (birth == "サガ地方")
                {
                    selectType |= UnitListFilterWindow.SelectType.BIRTH_SAGA;
                }
                else if (birth == "スロウスシュタイン")
                {
                    selectType |= UnitListFilterWindow.SelectType.BIRTH_SLOTH;
                }
                else if (birth == "ルストブルグ")
                {
                    selectType |= UnitListFilterWindow.SelectType.BIRTH_LUST;
                }
                else if (birth == "ワダツミ")
                {
                    selectType |= UnitListFilterWindow.SelectType.BIRTH_WADATSUMI;
                }
                else if (birth == "砂漠地帯")
                {
                    selectType |= UnitListFilterWindow.SelectType.BIRTH_DESERT;
                }
                else if (birth == "グリードダイク")
                {
                    selectType |= UnitListFilterWindow.SelectType.BIRTH_GREED;
                }
                else if (birth == "グラトニー=フォス")
                {
                    selectType |= UnitListFilterWindow.SelectType.BIRTH_GLUTTONY;
                }
                else if (birth == "その他")
                {
                    selectType |= UnitListFilterWindow.SelectType.BIRTH_OTHER;
                }
                else if (birth == "ノーザンブライド")
                {
                    selectType |= UnitListFilterWindow.SelectType.BIRTH_NOZ;
                }
            }
            return(selectType);
        }
Пример #8
0
        public void Refresh(bool is_hide = false)
        {
            UnitData unit = UnitEnhanceV3.Instance.CurrentUnit;

            DataSource.Bind <UnitData>(((Component)this).get_gameObject(), unit);
            for (int index = 0; index < this.UnitJobIconSetList.Count; ++index)
            {
                this.UnitJobIconSetList[index].ResetParam();
            }
            JobSetParam[] cc_jobset_array = MonoSingleton <GameManager> .Instance.GetClassChangeJobSetParam(unit.UnitID);

            if (cc_jobset_array == null)
            {
                cc_jobset_array = new JobSetParam[0];
            }
            this.mJobSetDatas.Clear();
            int key = 0;

            for (int i = 0; i < unit.Jobs.Length; ++i)
            {
                int index = Array.FindIndex <JobSetParam>(cc_jobset_array, (Predicate <JobSetParam>)(jobset => jobset.job == unit.Jobs[i].JobID));
                if (index >= 0)
                {
                    JobSetParam base_jobset_param = MonoSingleton <GameManager> .Instance.GetJobSetParam(cc_jobset_array[index].jobchange);

                    if (Array.FindIndex <JobData>(unit.Jobs, (Predicate <JobData>)(job => job.JobID == base_jobset_param.job)) < 0)
                    {
                        int[] numArray = new int[2] {
                            i, -1
                        };
                        this.mJobSetDatas.Add(key, numArray);
                        ++key;
                    }
                }
                else
                {
                    int num = -1;
                    for (int j = 0; j < cc_jobset_array.Length; ++j)
                    {
                        if (MonoSingleton <GameManager> .Instance.GetJobSetParam(cc_jobset_array[j].jobchange).job == unit.Jobs[i].JobID)
                        {
                            num = Array.FindIndex <JobData>(unit.Jobs, (Predicate <JobData>)(job => job.JobID == cc_jobset_array[j].job));
                            break;
                        }
                    }
                    int[] numArray = new int[2] {
                        i, num
                    };
                    this.mJobSetDatas.Add(key, numArray);
                    ++key;
                }
            }
            for (int index = 0; index < this.mJobIconScrollListController.Items.Count; ++index)
            {
                ((Component)this.mJobIconScrollListController.Items[index].job_icon).get_gameObject().SetActive(false);
            }
            if (this.mJobSetDatas.Count <= 2)
            {
                for (int job_index = 0; job_index < this.mJobSetDatas.Count; ++job_index)
                {
                    ((Component)this.mJobIconScrollListController.Items[job_index].job_icon).get_gameObject().SetActive(true);
                    this.RefreshJobIcon(((Component)this.mJobIconScrollListController.Items[job_index].job_icon).get_gameObject(), job_index);
                }
            }
            else
            {
                for (int index = 0; index < this.mJobIconScrollListController.Items.Count; ++index)
                {
                    ((Component)this.mJobIconScrollListController.Items[index].job_icon).get_gameObject().SetActive(true);
                    int job_index = int.Parse(((UnityEngine.Object) this.mJobIconScrollListController.Items[index].job_icon).get_name());
                    this.RefreshJobIcon(((Component)this.mJobIconScrollListController.Items[index].job_icon).get_gameObject(), job_index);
                }
            }
            this.mJobIconScrollListController.Repotision();
            List <GameObject> objects = new List <GameObject>();

            for (int index = 0; index < this.mJobIconScrollListController.Items.Count; ++index)
            {
                if (((UnityEngine.Object) this.mJobIconScrollListController.Items[index].job_icon.BaseJobIconButton).get_name() == UnitEnhanceV3.Instance.CurrentUnit.JobIndex.ToString())
                {
                    objects.Add(((Component)this.mJobIconScrollListController.Items[index].job_icon).get_gameObject());
                }
            }
            if (objects.Count <= 0)
            {
                for (int index = 0; index < this.mJobIconScrollListController.Items.Count; ++index)
                {
                    if (((UnityEngine.Object) this.mJobIconScrollListController.Items[index].job_icon.CcJobButton).get_name() == UnitEnhanceV3.Instance.CurrentUnit.JobIndex.ToString())
                    {
                        objects.Add(((Component)this.mJobIconScrollListController.Items[index].job_icon).get_gameObject());
                    }
                }
            }
            GameObject gameObject = this.ScrollClampedJobIcons.Focus(objects, true, is_hide, 0.0f);

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)gameObject, (UnityEngine.Object)null))
            {
                UnitInventoryJobIcon component = (UnitInventoryJobIcon)gameObject.GetComponent <UnitInventoryJobIcon>();
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null))
                {
                    UnitEnhanceV3.Instance.OnJobSlotClick(((Component)component.BaseJobIconButton).get_gameObject());
                }
            }
            this.mJobIconScrollListController.Step();
            DataSource.Bind <UnitData>(this.JobNameObject, unit);
            GameParameter.UpdateAll(((Component)this).get_gameObject());
            this.UpdateJobSlotStates(true);
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.SkinButton, (UnityEngine.Object)null))
            {
                ((Selectable)this.SkinButton).set_interactable(unit.IsSkinUnlocked());
            }
            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.VoiceButton, (UnityEngine.Object)null) || !UnityEngine.Object.op_Inequality((UnityEngine.Object) this.VoiceUnlock, (UnityEngine.Object)null))
            {
                return;
            }
            this.VoiceUnlock.SetActive(!unit.CheckUnlockPlaybackVoice());
        }
Пример #9
0
        public void Refresh(UnitData unit = null, JobParam jobUnlock = null)
        {
            if (unit == null)
            {
                return;
            }
            this.mCurrentUnit    = unit;
            this.mUnlockJobParam = jobUnlock;
            this.mUsedElemPieces.Clear();
            this.mCacheCCJobs.Clear();
            this.mTempUnit = new UnitData();
            this.mTempUnit.Setup(unit);
            for (int index = 0; index < this.mUnlockJobList.Count; ++index)
            {
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mUnlockJobList[index], (UnityEngine.Object)null))
                {
                    DataSource.Bind <JobParam>(this.mUnlockJobList[index], (JobParam)null);
                    this.mUnlockJobList[index].SetActive(false);
                }
            }
            int length = unit.Jobs.Length;

            if (this.mUnlockJobList.Count < length)
            {
                int num = length - this.mUnlockJobList.Count;
                for (int index = 0; index < num; ++index)
                {
                    GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.JobUnlock);
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)gameObject, (UnityEngine.Object)null))
                    {
                        gameObject.get_transform().SetParent((Transform)this.JobUnlockParent, false);
                        this.mUnlockJobList.Add(gameObject);
                    }
                }
            }
            JobSetParam[] changeJobSetParam = MonoSingleton <GameManager> .Instance.MasterParam.GetClassChangeJobSetParam(unit.UnitParam.iname);

            if (changeJobSetParam != null)
            {
                this.mCacheCCJobs.AddRange((IEnumerable <JobSetParam>)changeJobSetParam);
            }
            for (int jobNo = 0; jobNo < length; ++jobNo)
            {
                if (!unit.CheckJobUnlockable(jobNo) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mUnlockJobList[jobNo], (UnityEngine.Object)null))
                {
                    DataSource.Bind <JobParam>(this.mUnlockJobList[jobNo], unit.Jobs[jobNo].Param);
                }
            }
            DataSource.Bind <UnitData>(((Component)this).get_gameObject(), (UnitData)null);
            GameParameter.UpdateAll(((Component)this).get_gameObject());
            DataSource.Bind <UnitData>(((Component)this).get_gameObject(), this.mTempUnit);
            int  awakeLv = unit.AwakeLv;
            bool flag1   = unit.GetAwakeLevelCap() > awakeLv;

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.CautionObject, (UnityEngine.Object)null))
            {
                this.CautionObject.SetActive(!flag1);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.DecideButton, (UnityEngine.Object)null))
            {
                ((Selectable)this.DecideButton).set_interactable(flag1 && unit.CheckUnitAwaking());
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.SelectAwakeSlider, (UnityEngine.Object)null))
            {
                ((Selectable)this.SelectAwakeSlider).set_interactable(flag1 && unit.CheckUnitAwaking());
            }
            if (flag1)
            {
                PlayerData player          = MonoSingleton <GameManager> .Instance.Player;
                int        awakeNeedPieces = unit.GetAwakeNeedPieces();
                bool       flag2           = false;
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Kakera_Unit, (UnityEngine.Object)null))
                {
                    ItemData data = player.FindItemDataByItemID(unit.UnitParam.piece);
                    if (data == null)
                    {
                        ItemParam itemParam = MonoSingleton <GameManager> .Instance.MasterParam.GetItemParam(unit.UnitParam.piece);

                        if (itemParam == null)
                        {
                            DebugUtility.LogError("Not Unit Piece Settings => [" + unit.UnitParam.iname + "]");
                            return;
                        }
                        data = new ItemData();
                        data.Setup(0L, itemParam, 0);
                    }
                    if (data != null)
                    {
                        DataSource.Bind <ItemData>(this.Kakera_Unit, data);
                    }
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Kakera_Amount_Unit, (UnityEngine.Object)null))
                    {
                        this.Kakera_Amount_Unit.set_text(data.Num.ToString());
                    }
                    int num = Math.Min(awakeNeedPieces, data.Num);
                    if (awakeNeedPieces > 0)
                    {
                        num              = Math.Min(awakeNeedPieces, data.Num);
                        flag2            = true;
                        awakeNeedPieces -= num;
                    }
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Kakera_Consume_Unit, (UnityEngine.Object)null))
                    {
                        this.Kakera_Consume_Unit.set_text("@" + num.ToString());
                    }
                    this.Kakera_Unit.SetActive(true);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Kakera_Elem, (UnityEngine.Object)null))
                {
                    ItemData data = unit.GetElementPieceData();
                    if (data == null)
                    {
                        ItemParam elementPieceParam = unit.GetElementPieceParam();
                        if (elementPieceParam == null)
                        {
                            DebugUtility.LogError("[Unit Setting Error?]Not Element Piece!");
                            return;
                        }
                        data = new ItemData();
                        data.Setup(0L, elementPieceParam, 0);
                    }
                    if (data != null)
                    {
                        DataSource.Bind <ItemData>(this.Kakera_Elem, data);
                    }
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Kakera_Amount_Elem, (UnityEngine.Object)null))
                    {
                        this.Kakera_Amount_Elem.set_text(data.Num.ToString());
                    }
                    int num = Math.Min(awakeNeedPieces, data.Num);
                    if (data.Num > 0 && awakeNeedPieces > 0)
                    {
                        num              = Math.Min(awakeNeedPieces, data.Num);
                        flag2            = true;
                        awakeNeedPieces -= num;
                        if (!this.mUsedElemPieces.Contains(data))
                        {
                            this.mUsedElemPieces.Add(data);
                        }
                    }
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Kakera_Consume_Elem, (UnityEngine.Object)null))
                    {
                        this.Kakera_Consume_Elem.set_text("@" + num.ToString());
                    }
                    this.Kakera_Elem.SetActive(true);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Kakera_Common, (UnityEngine.Object)null))
                {
                    ItemData data = unit.GetCommonPieceData();
                    if (data == null)
                    {
                        ItemParam commonPieceParam = unit.GetCommonPieceParam();
                        if (commonPieceParam == null)
                        {
                            DebugUtility.LogError("[FixParam Setting Error?]Not Common Piece Settings!");
                            return;
                        }
                        data = new ItemData();
                        data.Setup(0L, commonPieceParam, 0);
                    }
                    if (data != null)
                    {
                        DataSource.Bind <ItemData>(this.Kakera_Common, data);
                    }
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Kakera_Amount_Common, (UnityEngine.Object)null))
                    {
                        this.Kakera_Amount_Common.set_text(data.Num.ToString());
                    }
                    int num = 0;
                    if (data.Num > 0 && awakeNeedPieces > 0)
                    {
                        num              = Math.Min(awakeNeedPieces, data.Num);
                        flag2            = true;
                        awakeNeedPieces -= num;
                        if (!this.mUsedElemPieces.Contains(data))
                        {
                            this.mUsedElemPieces.Add(data);
                        }
                    }
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Kakera_Consume_Common, (UnityEngine.Object)null))
                    {
                        this.Kakera_Consume_Common.set_text("@" + num.ToString());
                    }
                    this.Kakera_Common.SetActive(true);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.SelectAwakeSlider, (UnityEngine.Object)null))
                {
                    ItemData itemDataByItemId     = player.FindItemDataByItemID(unit.UnitParam.piece);
                    int      piece_amount         = itemDataByItemId == null ? 0 : itemDataByItemId.Num;
                    ItemData elementPieceData     = unit.GetElementPieceData();
                    int      element_piece_amount = elementPieceData == null ? 0 : elementPieceData.Num;
                    ItemData commonPieceData      = unit.GetCommonPieceData();
                    int      common_piece_amount  = commonPieceData == null ? 0 : commonPieceData.Num;
                    int      num = this.CalcCanAwakeMaxLv(unit.AwakeLv, unit.GetAwakeLevelCap(), piece_amount, element_piece_amount, common_piece_amount);
                    ((UnityEventBase)this.SelectAwakeSlider.get_onValueChanged()).RemoveAllListeners();
                    this.SelectAwakeSlider.set_minValue(num - unit.AwakeLv <= 0 ? 0.0f : 1f);
                    this.SelectAwakeSlider.set_maxValue((float)(num - unit.AwakeLv));
                    this.SelectAwakeSlider.set_value(this.SelectAwakeSlider.get_minValue());
                    // ISSUE: method pointer
                    ((UnityEvent <float>) this.SelectAwakeSlider.get_onValueChanged()).AddListener(new UnityAction <float>((object)this, __methodptr(OnAwakeLvSelect)));
                }
                if (this.mUnlockJobList != null)
                {
                    for (int index = 0; index < this.mUnlockJobList.Count && index <= length; ++index)
                    {
                        if (this.mCacheCCJobs != null && this.mCacheCCJobs.Count > 0)
                        {
                            JobSetParam js = unit.GetJobSetParam(index);
                            if (js == null || this.mCacheCCJobs.Find((Predicate <JobSetParam>)(v => v.iname == js.iname)) != null)
                            {
                                continue;
                            }
                        }
                        this.mUnlockJobList[index].SetActive(this.CheckUnlockJob(index, awakeLv + (int)this.SelectAwakeSlider.get_value()));
                    }
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.AwakeResultLv, (UnityEngine.Object)null))
                {
                    this.AwakeResultLv.set_text(LocalizedText.Get("sys.TEXT_UNITAWAKE_RESULT_LV", new object[1]
                    {
                        (object)(!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.SelectAwakeSlider, (UnityEngine.Object)null) ? 1 : (int)this.SelectAwakeSlider.get_value())
                    }));
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.AwakeResultComb, (UnityEngine.Object)null))
                {
                    this.AwakeResultComb.set_text(LocalizedText.Get("sys.TEXT_UNITAWAKE_RESULT_COMB", new object[1]
                    {
                        (object)(!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.SelectAwakeSlider, (UnityEngine.Object)null) ? 1 : (int)this.SelectAwakeSlider.get_value())
                    }));
                }
                int    num1 = 0;
                OInt[] artifactSlotUnlock = MonoSingleton <GameManager> .GetInstanceDirect().MasterParam.FixParam.EquipArtifactSlotUnlock;

                for (int index = 0; index < artifactSlotUnlock.Length; ++index)
                {
                    if ((int)artifactSlotUnlock[index] != 0 && (int)artifactSlotUnlock[index] > unit.AwakeLv && (int)artifactSlotUnlock[index] <= unit.AwakeLv + (int)this.SelectAwakeSlider.get_value())
                    {
                        ++num1;
                    }
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.UnlockArtifactSlot, (UnityEngine.Object)null))
                {
                    this.UnlockArtifactSlot.SetActive(num1 > 0);
                    if (num1 > 0)
                    {
                        this.AwakeResultArtifactSlots.set_text(LocalizedText.Get("sys.TEXT_UNITAWAKE_RESULT_SLOT", new object[1]
                        {
                            (object)num1
                        }));
                    }
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.NotPieceDataMask, (UnityEngine.Object)null))
                {
                    this.NotPieceDataMask.SetActive(awakeNeedPieces > 0);
                }
                if (flag2)
                {
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Kakera_Consume_Message, (UnityEngine.Object)null))
                    {
                        this.Kakera_Consume_Message.set_text(LocalizedText.Get(awakeNeedPieces != 0 ? "sys.CONFIRM_KAKUSEI4" : "sys.CONFIRM_KAKUSEI2"));
                    }
                }
                else
                {
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Kakera_Caution_Message, (UnityEngine.Object)null))
                    {
                        this.Kakera_Caution_Message.set_text(LocalizedText.Get("sys.CONFIRM_KAKUSEI3"));
                    }
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.CautionObject, (UnityEngine.Object)null))
                    {
                        this.CautionObject.SetActive(true);
                    }
                }
            }
            else if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Kakera_Caution_Message, (UnityEngine.Object)null))
            {
                this.Kakera_Caution_Message.set_text(LocalizedText.Get("sys.KAKUSEI_CAPPED"));
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.PlusBtn, (UnityEngine.Object)null))
            {
                ((Selectable)this.PlusBtn).set_interactable(UnityEngine.Object.op_Inequality((UnityEngine.Object) this.SelectAwakeSlider, (UnityEngine.Object)null) && (double)this.SelectAwakeSlider.get_value() < (double)this.SelectAwakeSlider.get_maxValue());
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.MinusBtn, (UnityEngine.Object)null))
            {
                ((Selectable)this.MinusBtn).set_interactable(UnityEngine.Object.op_Inequality((UnityEngine.Object) this.SelectAwakeSlider, (UnityEngine.Object)null) && (double)this.SelectAwakeSlider.get_value() > (double)this.SelectAwakeSlider.get_minValue());
            }
            this.RefreshGainedQuests(unit);
            GameParameter.UpdateAll(((Component)this).get_gameObject());
        }
Пример #10
0
        public void PointRefresh()
        {
            this.mUsedElemPieces.Clear();
            PlayerData player = MonoSingleton <GameManager> .GetInstanceDirect().Player;

            UnitData unitData = new UnitData();

            unitData.Setup(this.mCurrentUnit);
            int awake_lv = unitData.AwakeLv + (int)this.SelectAwakeSlider.get_value();
            int val1     = this.CalcNeedPieceAll((int)this.SelectAwakeSlider.get_value());

            this.mTempUnit.SetVirtualAwakeLv(Mathf.Min(unitData.GetAwakeLevelCap(), awake_lv - 1));
            int num1 = 0;

            OInt[] artifactSlotUnlock = MonoSingleton <GameManager> .GetInstanceDirect().MasterParam.FixParam.EquipArtifactSlotUnlock;

            for (int index = 0; index < artifactSlotUnlock.Length; ++index)
            {
                if ((int)artifactSlotUnlock[index] != 0 && (int)artifactSlotUnlock[index] > unitData.AwakeLv && (int)artifactSlotUnlock[index] <= unitData.AwakeLv + (int)this.SelectAwakeSlider.get_value())
                {
                    ++num1;
                }
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Kakera_Unit, (UnityEngine.Object)null))
            {
                ItemData itemData = player.FindItemDataByItemID(unitData.UnitParam.piece);
                if (itemData == null)
                {
                    ItemParam itemParam = MonoSingleton <GameManager> .Instance.MasterParam.GetItemParam(unitData.UnitParam.piece);

                    if (itemParam == null)
                    {
                        DebugUtility.LogError("Not Unit Piece Settings => [" + unitData.UnitParam.iname + "]");
                        return;
                    }
                    itemData = new ItemData();
                    itemData.Setup(0L, itemParam, 0);
                }
                int num2 = Math.Min(val1, itemData.Num);
                if (val1 > 0)
                {
                    num2  = Math.Min(val1, itemData.Num);
                    val1 -= num2;
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Kakera_Consume_Unit, (UnityEngine.Object)null))
                {
                    this.Kakera_Consume_Unit.set_text("@" + num2.ToString());
                }
                this.Kakera_Unit.SetActive(true);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Kakera_Elem, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Kakera_Elem, (UnityEngine.Object)null))
            {
                ItemData data = unitData.GetElementPieceData();
                if (data == null)
                {
                    ItemParam elementPieceParam = unitData.GetElementPieceParam();
                    if (elementPieceParam == null)
                    {
                        DebugUtility.LogError("[Unit Setting Error?]Not Element Piece!");
                        return;
                    }
                    data = new ItemData();
                    data.Setup(0L, elementPieceParam, 0);
                }
                if (data != null)
                {
                    DataSource.Bind <ItemData>(this.Kakera_Elem, data);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Kakera_Amount_Elem, (UnityEngine.Object)null))
                {
                    this.Kakera_Amount_Elem.set_text(data.Num.ToString());
                }
                int num2 = 0;
                if (data.Num > 0 && val1 > 0)
                {
                    num2  = Math.Min(val1, data.Num);
                    val1 -= num2;
                    if (!this.mUsedElemPieces.Contains(data))
                    {
                        this.mUsedElemPieces.Add(data);
                    }
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Kakera_Consume_Elem, (UnityEngine.Object)null))
                {
                    this.Kakera_Consume_Elem.set_text("@" + num2.ToString());
                }
                this.Kakera_Elem.SetActive(true);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Kakera_Common, (UnityEngine.Object)null))
            {
                ItemData data = unitData.GetCommonPieceData();
                if (data == null)
                {
                    ItemParam commonPieceParam = unitData.GetCommonPieceParam();
                    if (commonPieceParam == null)
                    {
                        DebugUtility.LogError("[FixParam Setting Error?]Not Common Piece Settings!");
                        return;
                    }
                    data = new ItemData();
                    data.Setup(0L, commonPieceParam, 0);
                }
                if (data != null)
                {
                    DataSource.Bind <ItemData>(this.Kakera_Common, data);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Kakera_Amount_Common, (UnityEngine.Object)null))
                {
                    this.Kakera_Amount_Common.set_text(data.Num.ToString());
                }
                int num2 = 0;
                if (data.Num > 0 && val1 > 0)
                {
                    num2 = Math.Min(val1, data.Num);
                    int num3 = val1 - num2;
                    if (!this.mUsedElemPieces.Contains(data))
                    {
                        this.mUsedElemPieces.Add(data);
                    }
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Kakera_Consume_Common, (UnityEngine.Object)null))
                {
                    this.Kakera_Consume_Common.set_text("@" + num2.ToString());
                }
                this.Kakera_Common.SetActive(true);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.AwakeResultLv, (UnityEngine.Object)null))
            {
                this.AwakeResultLv.set_text(LocalizedText.Get("sys.TEXT_UNITAWAKE_RESULT_LV", new object[1]
                {
                    (object)(!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.SelectAwakeSlider, (UnityEngine.Object)null) ? 1 : (int)this.SelectAwakeSlider.get_value())
                }));
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.AwakeResultComb, (UnityEngine.Object)null))
            {
                this.AwakeResultComb.set_text(LocalizedText.Get("sys.TEXT_UNITAWAKE_RESULT_COMB", new object[1]
                {
                    (object)(!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.SelectAwakeSlider, (UnityEngine.Object)null) ? 1 : (int)this.SelectAwakeSlider.get_value())
                }));
            }
            if (this.mUnlockJobList != null)
            {
                for (int index = 0; index < this.mUnlockJobList.Count && index <= unitData.Jobs.Length; ++index)
                {
                    if (this.mCacheCCJobs != null && this.mCacheCCJobs.Count > 0)
                    {
                        JobSetParam js = unitData.GetJobSetParam(index);
                        if (js == null || this.mCacheCCJobs.Find((Predicate <JobSetParam>)(v => v.iname == js.iname)) != null)
                        {
                            continue;
                        }
                    }
                    this.mUnlockJobList[index].SetActive(this.CheckUnlockJob(index, awake_lv));
                }
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.UnlockArtifactSlot, (UnityEngine.Object)null))
            {
                this.UnlockArtifactSlot.SetActive(num1 > 0);
                if (num1 > 0 && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.AwakeResultArtifactSlots, (UnityEngine.Object)null))
                {
                    this.AwakeResultArtifactSlots.set_text(LocalizedText.Get("sys.TEXT_UNITAWAKE_RESULT_SLOT", new object[1]
                    {
                        (object)num1
                    }));
                }
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.PlusBtn, (UnityEngine.Object)null))
            {
                ((Selectable)this.PlusBtn).set_interactable(UnityEngine.Object.op_Inequality((UnityEngine.Object) this.SelectAwakeSlider, (UnityEngine.Object)null) && (double)this.SelectAwakeSlider.get_value() < (double)this.SelectAwakeSlider.get_maxValue());
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.MinusBtn, (UnityEngine.Object)null))
            {
                ((Selectable)this.MinusBtn).set_interactable(UnityEngine.Object.op_Inequality((UnityEngine.Object) this.SelectAwakeSlider, (UnityEngine.Object)null) && (double)this.SelectAwakeSlider.get_value() > (double)this.SelectAwakeSlider.get_minValue());
            }
            GameParameter.UpdateAll(((Component)this).get_gameObject());
        }