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, 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; Button.interactable = true; if (Special) { if (ManaGarden.MyFlowerSpec == 0) { ManaReso.Get("G_Regular").TweenForVec(); ManaReso.SetActive("G_Special", true); } ManaGarden.MyFlowerSpec++; } else { ManaGarden.MyFlowerRegu++; } ManaData.SkillPlus += 0.1f; ManaDebug.Log(string.Format("获得{0} 收入+10%", Name)); } } } public string Name { get { return Language.GetStr("FlowerName", ID); } } public string ID { get { return "Flower" + ID_; } } public string Description { get { return Language.GetStr("FlowerDesc", ID); } } public Sprite Icon { get { return ManaReso.Load(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("FlowerItemG", Folder.UI, false, ManaReso.Get("G_RegularGrid"), false); Dictionary dic = new Dictionary(); Auxiliary.CompileDic(FlowerItem, dic); Text = dic["Lab"].GetComponent(); Image = dic["Icon"].GetComponent(); Button = dic["FlowerItemG"].GetComponent