WXGame/box1/Assets/Script/UI/PackPanel.cs
2024-11-08 18:21:41 +08:00

40 lines
807 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
public class PackPanel : MonoBehaviour
{
[SerializeField] private TextMeshProUGUI _textMeshPro;
[SerializeField] private Button packButton;
// Start is called before the first frame update
void Start()
{
}
private void OnEnable()
{
packButton.onClick.AddListener(ResetPanelData);
}
// Update is called once per frame
void Update()
{
}
private void OnDisable()
{
packButton.onClick.RemoveListener(ResetPanelData);
}
public void ResetPanelData()
{
GameManager.ins.PackEvent();
_textMeshPro.text = "剩余箱子数" + (GameManager.ins.index - 1);
}
}