Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using UnityEngine.SceneManagement;
- public class GameController : MonoBehaviour
- {
- public static GameController instance;
- public GameObject gameOverText;
- public bool gameOver = false;
- public float scrollSpeed = -1.5f;
- void Awake()
- {
- if (instance == null)
- {
- instance = this;
- }
- else if (instance != this)
- {
- Destroy(gameObject);
- }
- }
- void Update()
- {
- if (gameOver && Input.GetMouseButtonDown(0))
- {
- SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
- }
- }
- public void BirdDied()
- {
- gameOverText.SetActive(true);
- gameOver = true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment