using UnityEngine; using UnityEngine.UI; using System; using System.Xml; using System.Collections; using System.Collections.Generic; 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, Lock, Cool, UnLock, Upgrade, } public abstract class SkillRoot { #region 变量 #region 配置 public string Desc { get { return Language.GetStr("SkillDesc", ID); } } public string Name { get { return Language.GetStr("SkillName", ID); } } public virtual string ID { get { throw new Exception(); } } 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