using System; using UnityEngine; using System.Collections; using System.Collections.Generic; using System.Text; using System.Xml; using UnityEngine.UI; public enum AchieveType { AD, Skill, Sign, Share, Flower, Person, ElfLevel, TotalCoin, MiniGame, FlowerCoin, CurrentCoin, GardenLevel, } public class Achieve { public bool Regist { get { return _Regist; } set { _Regist = value; if (_Regist) { RegistValue(); } } } public string Desc { get { return Language.GetStr("AchieveDescription", "Achieve" + ID); } } public string Name { get { return Language.GetStr("AchieveName", "Achieve" + ID); } } public List PostAchieveList { get { if (_PostAchieveList == null) { _PostAchieveList = new List(); } return _PostAchieveList; } set { _PostAchieveList = value; } } public bool _Regist; public List _PostAchieveList; public int ID; public int Index; public int Parent; public bool Valid; public bool Finish; public bool Delete; public float Person; public float CoinPerson; public float DiamondOnce; public string Icon; public double TargetValue; public double CurrentValue; public AchieveType Type; public Text Tit; public Text Lab; public Text BtnLab; public Slider Slider; public Image Image; public Button Button; public Transform AchieveItem; public Achieve(XmlAttributeCollection attribute) { Valid = true; Icon = attribute[11].Value; Type = TypeParse(attribute[4].Value); Parent = ParentParse(attribute[6].Value); Delete = Convert.ToBoolean(int.Parse(attribute[7].Value)); TargetValue = double.Parse(attribute[5].Value); ID = int.Parse(attribute[0].Value); Index = int.Parse(attribute[1].Value); Person = AwardParse(attribute[10].Value); CoinPerson = AwardParse(attribute[9].Value); DiamondOnce = AwardParse(attribute[8].Value); ManaAchieve.AchieveDic.Add(ID, this); if (Parent != -1) { ManaAchieve.AchieveDic[ID].PostAchieveList.Add(this); } } public void RegistValue() { AchieveItem = ManaReso.Get("AchieveItem", Folder.UI, false, ManaReso.Get("M_Grid"), false); Dictionary dic = new Dictionary(); Auxiliary.CompileDic(AchieveItem, dic); Tit = dic["Tit"].GetComponent(); Lab = dic["Lab"].GetComponent(); Slider = dic["Slider"].GetComponent(); Image = dic["Icon"].GetComponent(); Button = dic["Btn"].GetComponent