Example #1
0
        public SkillData CreateDeriveSkill(SkillDeriveParam skillDeriveParam)
        {
            SkillData skillData = new SkillData();

            skillData.Setup(skillDeriveParam.DeriveSkillIname, this.Rank, 1, (MasterParam)null);
            skillData.m_OwnerAbility     = this.m_OwnerAbility;
            skillData.m_BaseSkillIname   = this.SkillID;
            skillData.m_SkillDeriveParam = skillDeriveParam;
            return(skillData);
        }
Example #2
0
        private void CreateDeriveSkillItem(SkillDeriveParam skillDeriveParam)
        {
            if (this.m_DeriveSkills == null)
            {
                this.m_DeriveSkills = new List <GameObject>();
            }
            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_DeriveSkillTemplate, (UnityEngine.Object)null))
            {
                return;
            }
            GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.m_DeriveSkillTemplate);

            DataSource.Bind <SkillAbilityDeriveParam>(gameObject, skillDeriveParam.m_SkillAbilityDeriveParam);
            DataSource.Bind <SkillParam>(gameObject, skillDeriveParam.m_DeriveParam);
            DataSource.Bind <SkillDeriveParam>(gameObject, skillDeriveParam);
            gameObject.SetActive(true);
            gameObject.get_transform().SetParent((Transform)this.m_DeriveSkillListRoot, false);
            this.m_DeriveSkills.Add(gameObject);
        }
        private static List <SkillAbilityDeriveListItem.ViewContentSkillParam> CreateViewContentSkillParams(List <SkillDeriveParam> deriveSkillParams)
        {
            List <SkillAbilityDeriveListItem.ViewContentSkillParam> contentSkillParamList = new List <SkillAbilityDeriveListItem.ViewContentSkillParam>();

            using (List <SkillDeriveParam> .Enumerator enumerator = deriveSkillParams.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    SkillDeriveParam skillDeriveParam = enumerator.Current;
                    SkillAbilityDeriveListItem.ViewContentSkillParam contentSkillParam = contentSkillParamList.Find((Predicate <SkillAbilityDeriveListItem.ViewContentSkillParam>)(content => content.m_BaseSkillParam == skillDeriveParam.m_BaseParam));
                    if (contentSkillParam == null)
                    {
                        contentSkillParam = new SkillAbilityDeriveListItem.ViewContentSkillParam();
                        contentSkillParam.m_SkillDeriveParams = new List <SkillDeriveParam>();
                        contentSkillParamList.Add(contentSkillParam);
                    }
                    contentSkillParam.m_BaseSkillParam = skillDeriveParam.m_BaseParam;
                    contentSkillParam.m_SkillDeriveParams.Add(skillDeriveParam);
                }
            }
            return(contentSkillParamList);
        }
        private List <SkillDeriveParam> GetSkillDeriveParams(MasterParam masterParam)
        {
            List <SkillDeriveParam> skillDeriveParamList = new List <SkillDeriveParam>();

            if (this.base_skills == null || this.derive_skills == null)
            {
                return(skillDeriveParamList);
            }
            for (int index = 0; index < this.base_skills.Length; ++index)
            {
                string baseSkill   = this.base_skills[index];
                string deriveSkill = this.derive_skills[index];
                if ((!string.IsNullOrEmpty(baseSkill) || !string.IsNullOrEmpty(deriveSkill)) && (!string.IsNullOrEmpty(baseSkill) && !string.IsNullOrEmpty(deriveSkill)))
                {
                    SkillDeriveParam skillDeriveParam = new SkillDeriveParam();
                    skillDeriveParam.m_BaseParam               = masterParam.GetSkillParam(baseSkill);
                    skillDeriveParam.m_DeriveParam             = masterParam.GetSkillParam(deriveSkill);
                    skillDeriveParam.m_SkillAbilityDeriveParam = this;
                    skillDeriveParamList.Add(skillDeriveParam);
                }
            }
            return(skillDeriveParamList);
        }
Example #5
0
        public void Setup(SkillAbilityDeriveParam skillAbilityDeriveParam, List <SkillAbilityDeriveParam> additionalSkillAbilityDeriveParams)
        {
            this.m_SkillDeriveData         = new List <SkillDeriveData>();
            this.m_AbilityDeriveData       = new List <AbilityDeriveData>();
            this.m_SkillAbilityDeriveParam = skillAbilityDeriveParam;
            IEnumerable <SkillDeriveData>   collection1 = this.m_SkillAbilityDeriveParam.SkillDeriveParams.Select <SkillDeriveParam, SkillDeriveData>((Func <SkillDeriveParam, SkillDeriveData>)(param => new SkillDeriveData(param)));
            IEnumerable <AbilityDeriveData> collection2 = this.m_SkillAbilityDeriveParam.AbilityDeriveParams.Select <AbilityDeriveParam, AbilityDeriveData>((Func <AbilityDeriveParam, AbilityDeriveData>)(param => new AbilityDeriveData(param)));

            this.m_SkillDeriveData.AddRange(collection1);
            this.m_AbilityDeriveData.AddRange(collection2);
            Dictionary <string, int> dictionary = new Dictionary <string, int>();

            using (List <SkillDeriveData> .Enumerator enumerator = this.m_SkillDeriveData.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    SkillDeriveData current = enumerator.Current;
                    if (!dictionary.ContainsKey(current.Param.BaseSkillIname))
                    {
                        dictionary.Add(current.Param.BaseSkillIname, this.MasterIndex);
                    }
                }
            }
            using (List <AbilityDeriveData> .Enumerator enumerator = this.m_AbilityDeriveData.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    AbilityDeriveData current = enumerator.Current;
                    if (!dictionary.ContainsKey(current.Param.BaseAbilityIname))
                    {
                        dictionary.Add(current.Param.BaseAbilityIname, this.MasterIndex);
                    }
                }
            }
            using (List <SkillAbilityDeriveParam> .Enumerator enumerator1 = additionalSkillAbilityDeriveParams.GetEnumerator())
            {
                while (enumerator1.MoveNext())
                {
                    SkillAbilityDeriveParam current1 = enumerator1.Current;
                    if (!this.m_AdditionalSkillAbilityDeriveParam.Contains(current1))
                    {
                        this.m_AdditionalSkillAbilityDeriveParam.Add(current1);
                    }
                    List <SkillDeriveParam>   skillDeriveParams   = current1.SkillDeriveParams;
                    List <AbilityDeriveParam> abilityDeriveParams = current1.AbilityDeriveParams;
                    using (List <SkillDeriveParam> .Enumerator enumerator2 = skillDeriveParams.GetEnumerator())
                    {
                        while (enumerator2.MoveNext())
                        {
                            SkillDeriveParam current2 = enumerator2.Current;
                            int num = -1;
                            if (dictionary.TryGetValue(current2.BaseSkillIname, out num))
                            {
                                num = Mathf.Min(current2.MasterIndex, num);
                                dictionary[current2.BaseSkillIname] = num;
                            }
                            else
                            {
                                dictionary.Add(current2.BaseSkillIname, current2.MasterIndex);
                            }
                            this.m_SkillDeriveData.Add(new SkillDeriveData(current2)
                            {
                                IsAdd = true
                            });
                        }
                    }
                    using (List <AbilityDeriveParam> .Enumerator enumerator2 = abilityDeriveParams.GetEnumerator())
                    {
                        while (enumerator2.MoveNext())
                        {
                            AbilityDeriveParam current2 = enumerator2.Current;
                            int num = -1;
                            if (dictionary.TryGetValue(current2.BaseAbilityIname, out num))
                            {
                                num = Mathf.Min(current2.MasterIndex, num);
                                dictionary[current2.BaseAbilityIname] = num;
                            }
                            else
                            {
                                dictionary.Add(current2.BaseAbilityIname, current2.MasterIndex);
                            }
                            this.m_AbilityDeriveData.Add(new AbilityDeriveData(current2)
                            {
                                IsAdd = true
                            });
                        }
                    }
                }
            }
            using (List <AbilityDeriveData> .Enumerator enumerator = this.m_AbilityDeriveData.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    AbilityDeriveData current = enumerator.Current;
                    int num = -1;
                    if (dictionary.TryGetValue(current.Param.BaseAbilityIname, out num))
                    {
                        current.IsDisable = current.Param.MasterIndex > num;
                    }
                }
            }
            using (List <SkillDeriveData> .Enumerator enumerator = this.m_SkillDeriveData.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    SkillDeriveData current = enumerator.Current;
                    int             num     = -1;
                    if (dictionary.TryGetValue(current.Param.BaseSkillIname, out num))
                    {
                        current.IsDisable = current.Param.MasterIndex > num;
                    }
                }
            }
        }
 private static void AddSkillParam(List <AbilityDetailWindow.ViewContentParam> viewContentParams, SkillParam skillParam, SkillDeriveParam skillDeriveParam)
 {
     if (skillDeriveParam != null)
     {
         skillParam = skillDeriveParam.m_BaseParam;
     }
     AbilityDetailWindow.ViewContentParam viewContentParam1 = viewContentParams.Find((Predicate <AbilityDetailWindow.ViewContentParam>)(param => param.m_SkillParam == skillParam));
     if (viewContentParam1 != null)
     {
         viewContentParam1.m_SkillDeriveParams.Add(skillDeriveParam);
     }
     else
     {
         AbilityDetailWindow.ViewContentParam viewContentParam2 = new AbilityDetailWindow.ViewContentParam();
         viewContentParam2.m_SkillParam = skillParam;
         if (skillDeriveParam != null)
         {
             viewContentParam2.m_SkillDeriveParams = new List <SkillDeriveParam>();
             viewContentParam2.m_SkillDeriveParams.Add(skillDeriveParam);
         }
         viewContentParams.Add(viewContentParam2);
     }
 }