2024-12-21 19:57:23 +08:00

35 lines
646 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class DrawingWapenItem : ItemObj
{
[SerializeField] private Button _button;
public DrawingPanel panel;
private void Awake()
{
_button = GetComponent<Button>();
}
public void OnEnable()
{
_button.onClick.AddListener(ButtonEvent);
}
public void OnDisable()
{
_button.onClick.RemoveListener(ButtonEvent);
}
public void ButtonEvent()
{
if (DataManager.GetItemUnLock(itemId))
{
panel.OpenFree(itemId);
}
}
}