using UnityEngine; using UnityEngine.UI; using UnityEngine.Serialization; using UnityEngine.EventSystems; using System; using System.Xml; using System.Collections; using System.Collections.Generic; using Random = UnityEngine.Random; public enum OpType { Rip, Null, Water, Fertilize, } public class FlowerInfo { #region 变量 public bool Plant { get { return Plant_; } set { Plant_ = value; if (Plant_) { Text.SetActive(true); ManaLan.Add(Text, new LanStr("Object", "FlowerItemG_Lab")); UIPartical.Begin(); } else { Text.SetActive(false); } } } public bool Unlock { get { return Unlock_; } set { Unlock_ = value; if (Unlock_) { Image.material = null; if (Special) { if (ManaGarden.MyFlowerSpec == 0) { ManaReso.Get("G_Regular").TweenForVec(); ManaReso.SetActive("G_Special", true); } ManaGarden.MyFlowerSpec++; } else { ManaGarden.MyFlowerRegu++; } ManaCenter.SkillPlus += 0.1f; } } } public string ID { get { return "Flower" + ID_; } } public string Name { get { return Language.GetStr("FlowerName", ID); } } public string Description { get { return Language.GetStr("FlowerDesc", ID); } } public Sprite Icon { get { return ManaReso.LoadSprite(Icon_, Folder.Scene); } } public int ID_; public bool Plant_; public bool Unlock_; public string Icon_; public bool Special; public Slot Slot; public Text Text; public Image Image; public Button Button; public UIPartical UIPartical; public Transform FlowerItem; #endregion public FlowerInfo(XmlAttributeCollection attribute) { FlowerItem = ManaReso.Get("FlowerItem", Folder.UI, false, ManaReso.Get("G_RegularGrid"), false, ObjType.FlowerItem); Dictionary dic = new Dictionary(); Auxiliary.CompileDic(FlowerItem, dic); Text = dic["Lab"].GetComponent(); Image = dic["Icon"].GetComponent(); Button = dic["FlowerItem"].GetComponent