using UnityEngine; using UnityEngine.UI; using System; using System.Xml; using System.Text; using System.Collections; using System.Collections.Generic; using Random = UnityEngine.Random; public class Ability : SkillRoot { #region 变量 #region 配置 public override string ID { get { return "Ability" + ID_; } } public float Person; public float SkillCD; public float CoinPerson; public double UpgradeAmt; public float Plus; public float PersonBuff; public float SkillCdBuff; public int UnlockLv; public float UnlockAmt; public float UnlockAheadAmt; public string UnlockPos; public Current UnlockCur; public Current UpgradeCur; public Current UnlockAheadCur; public string Label; public string Anim; public string UpgradeCD; public string UpgradeFml; public string UpgradePlus; public string UpgradePerson; #endregion public bool ElfLock = true; public string Elf; public string Item; public float NewPlus; public float NewPerson; public float NewSkillCD; public float NewSkillCdBuff; public float NewPersonBuff; public float NewCoinPerson; public double NewUpgradeAmt; public override SkillStatus ItemStatus { get { return ItemStatus_; } set { ItemStatus_ = value; if (ItemStatus_ == SkillStatus.Lock) { if (UnlockAheadCur == Current.Free) { ItemBtn.interactable = false; ManaLan.Add(ItemBtnLab, new LanStr("UI", "Fe_BtnLab1"), "\n", new LanStr("UI", "Fe_BtnLab4"), UnlockLv.ToString()); } else { ItemBtn.interactable = true; ManaLan.Add(ItemBtnLab, new LanStr("UI", "Fe_BtnLab0"), "\n", new LanStr("UI", "Fe_BtnLab4"), UnlockLv.ToString()); } } else if (ItemStatus_ == SkillStatus.UnLock) { ItemBtn.interactable = true; ItemBtnLab.text = Language.GetStr("UI", "Fe_BtnLab1") + "\n" + ImageParse(UnlockCur) + Auxiliary.ShrinkNumberStr(UnlockAmt); } else if (ItemStatus_ == SkillStatus.Upgrade) { ItemBtn.interactable = true; ItemBtnLab.text = Language.GetStr("UI", "Fe_BtnLab2") + "\n" + ImageParse(UpgradeCur) + Auxiliary.ShrinkNumberStr(NewUpgradeAmt); } } } #endregion public Ability(XmlAttributeCollection attribute) { #region 配置 ID_ = int.Parse(attribute[0].Value); Icon_ = attribute[20].Value; Anim = attribute[21].Value; Label = attribute[22].Value; UnlockPos = attribute[12].Value; UpgradeCD = attribute[18].Value; UpgradeFml = attribute[15].Value; UpgradePlus = attribute[16].Value; UpgradePerson = attribute[17].Value; UnlockLv = Auxiliary.IntParse(attribute[7].Value,0); ItemIndex = Auxiliary.IntParse(attribute[3].Value,0); UnlockAmt = Auxiliary.FloatParse(attribute[11].Value,0); UnlockAheadAmt = Auxiliary.FloatParse(attribute[9].Value,0); SkillTab = SkillClassParse(attribute[2].Value); UpgradeAmt = UpgradeAmtParse(attribute[14].Value); UnlockCur = CurrentParse(attribute[10].Value); UpgradeCur = CurrentParse(attribute[13].Value); UnlockAheadCur = CurrentParse(attribute[8].Value); ValueBuffParse(out Person, out PersonBuff, attribute[5].Value); ValueBuffParse(out SkillCD, out SkillCdBuff, attribute[6].Value); ValueBuffParse(out CoinPerson, out Plus, attribute[4].Value); #endregion SkillType = SkillType.Ability; } public void UnlockTab() { ManaReso.Get("F_Elf").material = null; ManaReso.Get("F_Store").material = null; ManaReso.Get("F_Magic").material = null; ManaReso.Get("F_ElfLab").material = null; ManaReso.Get("F_StoreLab").material = null; ManaReso.Get("F_MagicLab").material = null; ManaReso.Get