2024-12-09 11:56:41 +08:00
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
2024-12-09 18:01:59 +08:00
|
|
|
|
using System.Threading.Tasks;
|
2024-12-09 11:56:41 +08:00
|
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
|
|
|
|
public class StopBtn : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
public Image startImage;
|
|
|
|
|
public Image stopImage;
|
|
|
|
|
public Button stopBtn;
|
|
|
|
|
|
2024-12-09 18:01:59 +08:00
|
|
|
|
public GameObject panelPrefab;
|
|
|
|
|
|
2024-12-09 11:56:41 +08:00
|
|
|
|
int number;
|
|
|
|
|
// Start is called before the first frame update
|
|
|
|
|
void Start()
|
|
|
|
|
{
|
2024-12-09 18:01:59 +08:00
|
|
|
|
GameSatrt();
|
2024-12-09 11:56:41 +08:00
|
|
|
|
stopBtn = GetComponent<Button>();
|
2024-12-09 18:01:59 +08:00
|
|
|
|
stopBtn.onClick.AddListener(async ()=>{
|
|
|
|
|
GameStop();
|
|
|
|
|
|
2024-12-11 17:08:26 +08:00
|
|
|
|
GameObject obj = Instantiate(panelPrefab,GameObject.Find("Canvas").transform);
|
|
|
|
|
obj.GetComponent<Beat_ZanTing>().sBtn = this;//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD>ű<EFBFBD>
|
2024-12-09 18:01:59 +08:00
|
|
|
|
await Task.Delay(500);
|
|
|
|
|
gameGlobal.GameStop();
|
2024-12-11 17:08:26 +08:00
|
|
|
|
|
2024-12-09 18:01:59 +08:00
|
|
|
|
});
|
2024-12-09 11:56:41 +08:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2024-12-11 17:08:26 +08:00
|
|
|
|
public void GameStop()
|
2024-12-09 18:01:59 +08:00
|
|
|
|
{
|
|
|
|
|
startImage.gameObject.SetActive(true);
|
|
|
|
|
stopImage.gameObject.SetActive(false);
|
2024-12-09 11:56:41 +08:00
|
|
|
|
}
|
|
|
|
|
|
2024-12-11 17:08:26 +08:00
|
|
|
|
public void GameSatrt()
|
2024-12-09 11:56:41 +08:00
|
|
|
|
{
|
2024-12-09 18:01:59 +08:00
|
|
|
|
startImage.gameObject.SetActive(false);
|
|
|
|
|
stopImage.gameObject.SetActive(true);
|
2024-12-09 11:56:41 +08:00
|
|
|
|
}
|
2024-12-09 18:01:59 +08:00
|
|
|
|
|
2024-12-09 11:56:41 +08:00
|
|
|
|
}
|