using UnityEngine; using UnityEngine.UI; using System; using System.Collections; using System.Collections.Generic; using System.Xml; public enum Current { AD, Free, Coin, Cash, Other, Diamond, } public enum SkillTab { Elf, Null, Store, Magic, Garden, } public enum SkillType { Skill, Pack, Ability, BigSkill, } public enum SkillStatus { Buy, Use, Cool, Lock, UnLock, Upgrade, } public abstract class SkillRoot { #region 变量 #region 配置 public string Desc { get { return Language.GetStr("SkillDescription", _Name); } set { _Desc = value; } } public string Name { get { return Language.GetStr("SkillName", _Name); } set { _Name = value; } } public string _Desc; public string _Name; public int ID; public int ClassID; public string Icon; #endregion public int Level; public Text ItemTit; public Text ItemLab; public Text ItemBtnLab; public Image ItemIcon; public Button ItemBtn; public SkillTab SkillTab; public SkillType SkillType; public Transform SkillItem; public abstract void RegistValue(float elapse, List> ffList, XmlAttributeCollection attribute); public abstract void UpdateStatus(); #endregion public static int Sort(SkillRoot skillRootA, SkillRoot skillRootB) { if (skillRootA.ClassID == skillRootB.ClassID) { return 0; } else if (skillRootA.ClassID > skillRootB.ClassID) { return 1; } else if (skillRootA.ClassID < skillRootB.ClassID) { return -1; } else { throw new Exception(); } } public void SwitchLanguage() { if (ItemLab != null) { ItemLab.text = Description(0); } } public virtual void Annul() { } public virtual bool DoUse() { throw new Exception(); } public virtual void ReceiveCool(float amt, bool current, bool buff) { } public virtual void RegistReference() { if (SkillTab == SkillTab.Null) { return; } Dictionary childDic = new Dictionary(); Auxiliary.CompileDic(SkillItem, childDic); ItemTit = childDic["Tit"].GetComponent(); ItemBtn = childDic["Btn"].GetComponent