using UnityEngine; using UnityEngine.UI; using UnityEngine.Serialization; using UnityEngine.EventSystems; using System.Xml; using System.Collections; using System.Collections.Generic; public enum OpType { Rip, Water, Fertilize, } public class FlowerInfo { #region 变量 public bool Plant { get { return _Plant; } set { _Plant = value; if (_Plant) { Text.text = "已放置"; } else { Text.text = ""; } } } public bool Unlock { get { return _Unlock; } set { _Unlock = value; if (_Unlock) { Text.text = ""; 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++; } ManaGarden.UpdateCollectStatus(); ManaData.SkillPlus += 0.1f; ManaLog.Log("解锁花朵 收入+10%"); } } } public bool _Plant; public bool _Unlock; public int Id; public bool Special; public string Name; public string Description; public Text Text; public Sprite Sprite; public Image Image; public Button Button; #endregion public FlowerInfo(XmlAttributeCollection attributes) { Transform tra = ManaReso.Get("FlowerHouseItem", Folder.PrefabUI, false, ManaReso.Get("G_RegularGrid"), false); Text = tra.FindChild("Lab").GetComponent(); Image = tra.FindChild("Icon").GetComponent(); Button = tra.GetComponent