cnam-geometry-dash/Assets/LogicManagerScript.cs

28 lines
541 B
C#
Raw Permalink Normal View History

using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class LogicManagerScript : MonoBehaviour
{
public uint score = 0;
public Text scoreText;
public GameObject gameOverScreen;
[ContextMenu("AddScore")]
public void AddScore()
{
score += 1;
scoreText.text = score.ToString();
}
public void Restart()
{
SceneManager.LoadScene(SceneManager.GetActiveScene().name);
}
public void GameOver()
{
gameOverScreen.SetActive(true);
}
}