Chengiz
❔ GMT (The Unity Tutorial For Complete Beginners) help
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class InfoManager : MonoBehaviour
{
public int playerScore;
public Text highScore;
public GameObject gameOverScreen;
public GameObject stopPiping;
public void addScore(int scoreToAdd) { playerScore = playerScore + scoreToAdd; highScore.text = playerScore.ToString(); } public void restartGame() { SceneManager.LoadScene(SceneManager.GetActiveScene().name); } public void gameOver() { gameOverScreen.SetActive(true); stopPiping.SetActive(false); }
public void addScore(int scoreToAdd) { playerScore = playerScore + scoreToAdd; highScore.text = playerScore.ToString(); } public void restartGame() { SceneManager.LoadScene(SceneManager.GetActiveScene().name); } public void gameOver() { gameOverScreen.SetActive(true); stopPiping.SetActive(false); }
24 replies
❔ GMT (The Unity Tutorial For Complete Beginners) help
hmm i agree, have thought about it all day since im very nice to coding, i think i figured it out just now but not sure if i did it right at all? I made a public GameObject in my UI manager and connected that to the pipe object and in my GameOver function and i .SetActive as false when i get game over after collision. Can i do that?
24 replies