41 lines
758 B
C#
41 lines
758 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class DrawingItem : MonoBehaviour
|
|
{
|
|
private Button _button;
|
|
[SerializeField] private Image icon;
|
|
[SerializeField] private TextMeshProUGUI _proUGUI;
|
|
|
|
private void Awake()
|
|
{
|
|
_button = GetComponent<Button>();
|
|
}
|
|
|
|
private void OnEnable()
|
|
{
|
|
_button.onClick.AddListener(ButtonEvent);
|
|
}
|
|
|
|
private void OnDisable()
|
|
{
|
|
_button.onClick.RemoveListener(ButtonEvent);
|
|
}
|
|
|
|
void ButtonEvent()
|
|
{
|
|
|
|
}
|
|
|
|
public void InitData(int id)
|
|
{
|
|
var data = JsonTab.Instance.tables.Weapon.Get(id);
|
|
_proUGUI.text = data.Name;
|
|
|
|
}
|
|
}
|