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.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++;
}
ManaData.SkillPlus += 0.1f;
ManaDebug.Log(string.Format("获得{0} 收入+10%", Name));
}
}
}
public bool _Plant;
public bool _Unlock;
public int Id;
public bool Special;
public string Name;
public string Description;
public Slot Slot;
public Text Text;
public Sprite Sprite;
public Image Image;
public Button Button;
#endregion
public FlowerInfo(XmlAttributeCollection attributes)
{
Transform tra = ManaReso.Get("FlowerItemG", Folder.PrefabUI, false, ManaReso.Get("G_RegularGrid"), false);
Dictionary dic = new Dictionary();
Auxiliary.CompileDic(tra, dic);
Text = dic["Lab"].GetComponent();
Image = dic["Icon"].GetComponent();
Button = dic["FlowerItemG"].GetComponent