Exemple #1
0
        public void UpdateData(RoleData role, bool isLostKnowledge = false)
        {
            roleData         = role;
            _isLostKnowledge = isLostKnowledge;
            bookData         = !_isLostKnowledge?roleData.GetCurrentBook() : roleData.GetLostKnowledge();

            skillData = bookData != null?bookData.GetCurrentSkill() : null;
        }
Exemple #2
0
        public void RefreshView()
        {
            Icon.sprite = Statics.GetIconSprite(bookData.IconId);
            FlashImage.gameObject.SetActive(((int)bookData.Quality) >= ((int)QualityType.FlashGold));
            Name.text = string.Format("<color=\"{0}\">{1}</color>", Statics.GetQualityColorString(bookData.Quality), bookData.Name);
            TitleText.gameObject.SetActive(bookData.IsLostKnowledge);
//			Image iconImage;
//			for (int i = 0; i < SkillIcons.Length; i++) {
//				iconImage = SkillIcons[i];
//				if (bookData.Skills.Count > i) {
//					iconImage.gameObject.SetActive(true);
//					iconImage.sprite = Statics.GetIconSprite(bookData.Skills[i].IconId);
//				}
//				else {
//					iconImage.gameObject.SetActive(false);
//				}
//			}
//			DescText.gameObject.SetActive(bookData.Skills.Count == 0);
            string attrsStr = "";

            if (bookData.MagicAttackPlus > 0)
            {
                attrsStr += string.Format("内功+{0} ", bookData.MagicAttackPlus);
            }
            if (bookData.MagicDefensePlus > 0)
            {
                attrsStr += string.Format("内防+{0} ", bookData.MagicDefensePlus);
            }
            if (bookData.PhysicsDefensePlus > 0)
            {
                attrsStr += string.Format("外防+{0} ", bookData.PhysicsDefensePlus);
            }
            if (bookData.DodgePlus > 0)
            {
                attrsStr += string.Format("轻功+{0} ", bookData.DodgePlus);
            }
            if (bookData.HurtCutRatePlus > 0)
            {
                attrsStr += string.Format("伤害减免{0}% ", (int)(bookData.HurtCutRatePlus * 100 + 0.5f));
            }
            if (bookData.MaxHPPlus > 0)
            {
                attrsStr += string.Format("气血+{0} ", bookData.MaxHPPlus);
            }
            if (bookData.CanNotMoveResistance > 0)
            {
                attrsStr += string.Format("抗定身+{0} ", bookData.CanNotMoveResistance);
            }
            if (bookData.ChaosResistance > 0)
            {
                attrsStr += string.Format("抗混乱+{0} ", bookData.ChaosResistance);
            }
            if (bookData.DisarmResistance > 0)
            {
                attrsStr += string.Format("抗缴械+{0} ", bookData.DisarmResistance);
            }
            if (bookData.DrugResistance > 0)
            {
                attrsStr += string.Format("抗毒+{0} ", bookData.DrugResistance);
            }
            if (bookData.SlowResistance > 0)
            {
                attrsStr += string.Format("抗迟缓+{0} ", bookData.SlowResistance);
            }
            if (bookData.VertigoResistance > 0)
            {
                attrsStr += string.Format("抗眩晕+{0} ", bookData.VertigoResistance);
            }
            DescText.text = string.Format("{0}", bookData.GetCurrentSkill() != null ? bookData.GetCurrentSkill().Desc.Replace(" ", "") : "<color=\"#00FFFF\">内功心法</color>\n(可以与秘籍同时装备)");
            if (bookData.BeUsingByRoleId != "")
            {
                UseBtn.gameObject.SetActive(false);
                UnuseBtn.gameObject.SetActive(true);
                bg.sprite = Statics.GetSprite("Border12");
            }
            else
            {
                UseBtn.gameObject.SetActive(true);
                UnuseBtn.gameObject.SetActive(false);
                bg.sprite = Statics.GetSprite("Border11");
            }
        }
Exemple #3
0
        public override void RefreshView()
        {
            iconImage.sprite = Statics.GetIconSprite(bookData.IconId);
            flashImage.gameObject.SetActive(((int)bookData.Quality) >= ((int)QualityType.FlashGold));
            nameText.text = string.Format("<color=\"{0}\">{1}</color>", Statics.GetQualityColorString(bookData.Quality), bookData.Name);
            descText.text = string.Format("{0}{1}{2}{3}\n描述:\n{4}",
                                          bookData.GetCurrentSkill() != null ? bookData.GetCurrentSkill().Desc : "心法无招式",
                                          bookData.LimitWeaponType != WeaponType.None ? string.Format("\n兵器限制:{0}", Statics.GetEnmuDesc <WeaponType>(bookData.LimitWeaponType)) : "",
                                          info != "" ? string.Format("\n附加属性:\n<color=\"#00FF00\">{0}</color>", info) : "",
                                          secretInfo != "" ? string.Format("\n诀要加成属性:\n<color=\"#00FF00\">{0}</color>", secretInfo) : "",
                                          !string.IsNullOrEmpty(bookData.Desc) ? bookData.Desc : "无");
            if (bookData.IsMindBook)
            {
                titleText.text = "心法";
            }
            else if (bookData.IsLostKnowledge)
            {
                titleText.text = "绝学";
            }
            else
            {
                titleText.text = "秘籍";
            }
            if (prefabObj == null)
            {
                prefabObj = Statics.GetPrefab("Prefabs/UI/GridItems/SkillItemContainer");
            }
            StartCoroutine(refreshHeight());
            if (!bookData.IsMindBook)
            {
                secretsDescText.text = string.Format("修为:\n{0}/{1}", expAndSecretData.Exp.Cur, expAndSecretData.Exp.Max > 0 ? Statics.GetBookStepExp(expAndSecretData.Exp.Cur) : 0);
                studyText.text       = string.Format("领悟:{0}/{1}", expAndSecretData.Secrets.Count, Statics.GetBookLV(expAndSecretData.Exp.Cur));
                MakeButtonEnable(studyBtn, true);
            }
            else
            {
                secretsDescText.text = "修为:\n不可修炼";
                studyText.text       = "不可领悟";
                MakeButtonEnable(studyBtn, false);
            }
//			if (bookData.Skills.Count > 0) {
//				emptyImage.gameObject.SetActive(false);
//				SkillData skill;
//				GameObject itemPrefab;
//				SkillItemContainer container;
//				for (int i = 0; i < bookData.Skills.Count; i++) {
//					skill = bookData.Skills[i];
//					if (containers.Count <= i) {
//						itemPrefab = Statics.GetPrefabClone(prefabObj);
//						MakeToParent(gridTrans.transform, itemPrefab.transform);
//						container = itemPrefab.GetComponent<SkillItemContainer>();
//						containers.Add(container);
//					}
//					else {
//						container = containers[i];
//					}
//					container.UpdateData(skill, i != bookData.Skills.Count - 1);
//					container.RefreshView();
//				}
//			}
//			else {
//				emptyImage.gameObject.SetActive(true);
//			}
        }