//-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Monday, April 01, 2019 //-------------------------------------------------------- using UnityEngine; using System.Collections; using UnityEngine.UI; namespace Snxxz.UI { public class TipOperateButton : MonoBehaviour { [SerializeField] Button m_Button; [SerializeField] Text m_Title; ItemOperateType operateType; string guid; public void SetActive(bool active) { this.gameObject.SetActive(active); } public void Bind(ItemOperateType type, string guid) { operateType = type; this.guid = guid; switch (type) { case ItemOperateType.putAway: this.m_Title.text = "上架"; break; case ItemOperateType.sell: this.m_Title.text = "出售"; break; case ItemOperateType.makeUse: this.m_Title.text = "使用"; break; default: this.m_Title.text = ""; break; } m_Button.SetListener(() => { WindowCenter.Instance.Close(); EquipTipUtility.Operate(operateType, this.guid); }); } } }