2024-12-10 17:46:37 +08:00

41 lines
840 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using cfg.BlacksmithData;
using UnityEngine;
using UnityEngine.UI;
public class RogenItem : MonoBehaviour
{
[SerializeField] private Text describe;
[SerializeField] private Button _button;
[SerializeField] private SkillRogueData skillData;
private void Awake()
{
_button = GetComponent<Button>();
}
private void OnEnable()
{
_button.onClick.AddListener(SendEvent);
}
private void OnDisable()
{
_button.onClick.RemoveListener(SendEvent);
}
public void SetData(SkillRogueData data)
{
describe.text = data.Describe;
skillData = data;
}
private void SendEvent()
{
BattleManager.ins.SetRogen(skillData);
UIMgr.ins.CloseRogenPanel();
}
}