2024-11-08 18:21:41 +08:00
|
|
|
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;
|
2024-11-21 09:35:48 +08:00
|
|
|
|
|
|
|
[SerializeField] private TextMeshProUGUI _moveTimeText;
|
|
|
|
|
|
|
|
[SerializeField] private TextMeshProUGUI _speedText;
|
|
|
|
|
|
|
|
[SerializeField] private TextMeshProUGUI _pointsText;
|
2024-11-08 18:21:41 +08:00
|
|
|
// 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);
|
|
|
|
}
|
2024-11-21 09:35:48 +08:00
|
|
|
|
|
|
|
public void ResetPropattributes()
|
|
|
|
{
|
|
|
|
_moveTimeText.text = "移动时间" + ItemSystem.ins.moveTime;
|
|
|
|
_speedText.text = "移动速度" + ItemSystem.ins.speed;
|
|
|
|
_pointsText.text = "积分" + ItemSystem.ins.points;
|
|
|
|
}
|
2024-11-08 18:21:41 +08:00
|
|
|
}
|