Exemple #1
0
 private void SetupDefaultSubSkillList()
 {
     this.avatarSubSkillList = new List <AvatarSubSkillDataItem>();
     this._avatarSubSkillMap = new Dictionary <int, AvatarSubSkillDataItem>();
     foreach (int num in AvatarSubSkillMetaDataReaderExtend.GetAvatarSubSkillIdList(this.skillID))
     {
         AvatarSubSkillDataItem item = new AvatarSubSkillDataItem(num, this.avatarID);
         this.avatarSubSkillList.Add(item);
         this._avatarSubSkillMap.Add(num, item);
     }
 }
        public AvatarSubSkillDialogContext(AvatarDataItem avatarData, AvatarSkillDataItem skillData, AvatarSubSkillDataItem subSkillData)
        {
            ContextPattern pattern = new ContextPattern {
                contextName    = "AvatarSubSkillDialogContext",
                viewPrefabPath = "UI/Menus/Dialog/AvatarSubSkillDialog"
            };

            base.config       = pattern;
            this.avatarData   = avatarData;
            this.skillData    = skillData;
            this.subSkillData = subSkillData;
        }
Exemple #3
0
 private static bool CheckUnlockBySubSkillIDAndAddParam(ConfigAvatarAbilityUnlock unlockConfig, AvatarDataItem avatarDataItem, out AvatarSubSkillDataItem outSubSkillItem, bool useLeaderSkill)
 {
     for (int i = 0; i < avatarDataItem.skillDataList.Count; i++)
     {
         AvatarSkillDataItem item = avatarDataItem.skillDataList[i];
         if (!item.IsLeaderSkill || useLeaderSkill)
         {
             for (int j = 0; j < item.avatarSubSkillList.Count; j++)
             {
                 AvatarSubSkillDataItem item2 = item.avatarSubSkillList[j];
                 if ((item2.subSkillID == unlockConfig.UnlockBySubSkillID) && item2.UnLocked)
                 {
                     outSubSkillItem = item2;
                     return(true);
                 }
             }
         }
     }
     outSubSkillItem = null;
     return(false);
 }
        public void SetupView(AvatarDataItem avatarDataItem, AvatarSkillDataItem skillData, AvatarSubSkillDataItem subSkillData, bool isRemoteAvatar)
        {
            this._avatarData     = avatarDataItem;
            this._skillData      = skillData;
            this._subSkillData   = subSkillData;
            this._isRemoteAvatar = isRemoteAvatar;
            base.transform.Find("Row/NameText").GetComponent <Text>().text     = this._subSkillData.Name;
            base.transform.Find("RowText/DescText").GetComponent <Text>().text = this._subSkillData.Info;
            this.SetupIcon();
            Transform transform = base.transform.Find("SkillIcon/UnLockInfo");
            bool      flag      = this._avatarData.level < this._subSkillData.UnlockLv;
            bool      flag2     = this._avatarData.star < this._subSkillData.UnlockStar;

            transform.gameObject.SetActive(!this._subSkillData.UnLocked);
            if (!this._subSkillData.UnLocked)
            {
                Transform transform2 = transform.Find("UnLockStar");
                Transform transform3 = transform.Find("UnLockLv");
                base.transform.Find("SkillIcon/Icon").GetComponent <Image>().color = MiscData.GetColor("SkillBtnGrey");
                if (flag2)
                {
                    transform2.gameObject.SetActive(true);
                    transform3.gameObject.SetActive(false);
                    transform2.Find("Star").GetComponent <MonoAvatarStar>().SetupView(this._subSkillData.UnlockStar);
                }
                else if (flag)
                {
                    transform2.gameObject.SetActive(false);
                    transform3.gameObject.SetActive(true);
                    transform3.Find("Lv").GetComponent <Text>().text = "Lv." + this._subSkillData.UnlockLv;
                }
                else
                {
                    transform2.gameObject.SetActive(false);
                    transform3.gameObject.SetActive(false);
                    base.transform.Find("SkillIcon/Icon").GetComponent <Image>().color = MiscData.GetColor("Blue");
                }
            }
            Transform transform4 = base.transform.Find("RowText/NextLv");
            Transform transform5 = base.transform.Find("RowText/NextStar");

            transform4.gameObject.SetActive(false);
            transform5.gameObject.SetActive(false);
            if (this._subSkillData.UnLocked && (this._subSkillData.level < this._subSkillData.MaxLv))
            {
                bool flag3 = this._avatarData.level < this._subSkillData.LvUpNeedAvatarLevel;
                if (this._avatarData.star < this._subSkillData.GetUpLevelStarNeed())
                {
                    transform4.gameObject.SetActive(false);
                    transform5.gameObject.SetActive(true);
                    transform5.Find("Star").GetComponent <MonoAvatarStar>().SetupView(this._subSkillData.GetUpLevelStarNeed());
                }
                else if (flag3)
                {
                    transform4.gameObject.SetActive(true);
                    transform5.gameObject.SetActive(false);
                    transform4.Find("Lv").GetComponent <Text>().text = "Lv." + this._subSkillData.LvUpNeedAvatarLevel;
                }
            }
            Text component = base.transform.Find("Row/AddPtText").GetComponent <Text>();

            component.gameObject.SetActive(this._subSkillData.UnLocked);
            if (this._subSkillData.level == this._subSkillData.MaxLv)
            {
                component.text = "MAX";
            }
            else
            {
                component.text = (this._subSkillData.level <= 0) ? string.Empty : string.Format("+{0}", this._subSkillData.level);
            }
            this.SetupSubSkillPopUp();
            if (this._subSkillData.level == this._subSkillData.MaxLv)
            {
                base.transform.Find("SkillIcon/PopUp").gameObject.SetActive(false);
            }
            base.transform.Find("SkillIcon/Max").gameObject.SetActive(this._subSkillData.level == this._subSkillData.MaxLv);
            base.transform.Find("SkillIcon/Upgradable").gameObject.SetActive(((!this._isRemoteAvatar && this._subSkillData.UnLocked) && ((this._subSkillData.level < this._subSkillData.MaxLv) && (this._avatarData.level >= this._subSkillData.LvUpNeedAvatarLevel))) && (this._avatarData.star >= this._subSkillData.GetUpLevelStarNeed()));
        }