46 lines
937 B
C#
46 lines
937 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class StopBtn : MonoBehaviour
|
|
{
|
|
public Image startImage;
|
|
public Image stopImage;
|
|
public Button stopBtn;
|
|
|
|
int number;
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
stopBtn = GetComponent<Button>();
|
|
stopBtn.onClick.AddListener(StopClick);
|
|
|
|
}
|
|
|
|
void StopClick()
|
|
{
|
|
number++;
|
|
if (number %2 != 0)
|
|
{
|
|
startImage.gameObject.SetActive(false);
|
|
stopImage.gameObject.SetActive(true);
|
|
UIContorl.instance.StopTimer();
|
|
}
|
|
else
|
|
{
|
|
startImage.gameObject.SetActive(true);
|
|
stopImage.gameObject.SetActive(false);
|
|
UIContorl.instance.StartTimer();
|
|
}
|
|
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
}
|