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 Config #region 配置 public float UnlockAheadAmt { get { return UnlockAheadBaseAmt + (UnlockLv - Manager.GardenLevel - 1)*UnlockAheadDeltaAmt; } } public override string FullID { get { return AbilityFullIDPrefix + ID; } } public static string ElfAnim = "Elf"; public static string ItemAnim = "Item"; 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 UnlockAheadBaseAmt; public float UnlockAheadDeltaAmt; 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 ElfFlag = 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) { button.interactable = false; LanguageManager.Add(ButtonTitle, new MulLanStr(LanguageLabel.UI__Fe_BtnLab1), "\n", new MulLanStr(LanguageLabel.UI__Fe_BtnLab4), UnlockLv.ToString()); } else { button.interactable = true; LanguageManager.Add(ButtonTitle, new MulLanStr(LanguageLabel.UI__Fe_BtnLab0), "\n", new MulLanStr(LanguageLabel.UI__Fe_BtnLab4), UnlockLv.ToString()); } } else if (itemStatus == SkillStatus.UnLock) { button.interactable = true; ButtonTitle.text = Language.GetStr(LanguageLabel.UI__Fe_BtnLab1) + "\n" + Auxiliary.ImageParse(UnlockCur) + Auxiliary.ShrinkBigNumberStr(UnlockAmt); } else if (itemStatus == SkillStatus.Upgrade) { button.interactable = true; ButtonTitle.text = Language.GetStr(LanguageLabel.UI__Fe_BtnLab2) + "\n" + Auxiliary.ImageParse(UpgradeCur) + Auxiliary.ShrinkBigNumberStr(NewUpgradeAmt); } } } private static int BannedSlotIndexForZoomIn = 4; #endregion public Ability(XmlAttributeCollection attribute) { #region 配置 ID = int.Parse(attribute[0].Value); icon = attribute[21].Value; Anim = attribute[22].Value; Label = attribute[23].Value; UnlockPos = attribute[13].Value; UpgradeCD = attribute[19].Value; UpgradeFml = attribute[16].Value; UpgradePlus = attribute[17].Value; UpgradePerson = attribute[18].Value; UnlockLv = Auxiliary.StringToInt(attribute[7].Value,0); ItemIndex = Auxiliary.StringToInt(attribute[3].Value,0); UnlockAmt = Auxiliary.StringToFloat(attribute[12].Value,0); UnlockAheadBaseAmt = Auxiliary.StringToFloat(attribute[10].Value,0); UnlockAheadDeltaAmt = Auxiliary.StringToFloat(attribute[9].Value, 0); SkillTab = SkillClassParse(attribute[2].Value); UpgradeAmt = GetUpgradeAmt(attribute[15].Value); UnlockCur = Auxiliary.CurrentParse(attribute[11].Value); UpgradeCur = Auxiliary.CurrentParse(attribute[14].Value); UnlockAheadCur = Auxiliary.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() { ResourceManager.Get(CanvasLabel.F_Elf).material = null; ResourceManager.Get(CanvasLabel.F_Store).material = null; ResourceManager.Get(CanvasLabel.F_Magic).material = null; ResourceManager.Get(CanvasLabel.F_ElfLab).material = null; ResourceManager.Get(CanvasLabel.F_StoreLab).material = null; ResourceManager.Get(CanvasLabel.F_MagicLab).material = null; ResourceManager.Get