47 lines
1.0 KiB
C#
47 lines
1.0 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class StopBtn : MonoBehaviour
|
|
{
|
|
public Image startImage;
|
|
public Image stopImage;
|
|
public Button stopBtn;
|
|
|
|
public GameObject panelPrefab;
|
|
|
|
int number;
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
GameSatrt();
|
|
stopBtn = GetComponent<Button>();
|
|
stopBtn.onClick.AddListener(async ()=>{
|
|
GameStop();
|
|
|
|
GameObject obj = Instantiate(panelPrefab,GameObject.Find("Canvas").transform);
|
|
obj.GetComponent<Beat_ZanTing>().sBtn = this;//»ñÈ¡µ½½çÃæÔÝÍ£½Å±¾
|
|
await Task.Delay(500);
|
|
gameGlobal.GameStop();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
public void GameStop()
|
|
{
|
|
startImage.gameObject.SetActive(true);
|
|
stopImage.gameObject.SetActive(false);
|
|
}
|
|
|
|
public void GameSatrt()
|
|
{
|
|
startImage.gameObject.SetActive(false);
|
|
stopImage.gameObject.SetActive(true);
|
|
}
|
|
|
|
}
|