
자료에 있는 내용대로 작성을 해봤는데도
똑같이 안되고 있습니다.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class gameManager : MonoBehaviour
{
public GameObject square;
public Text timeTxt;
public Text thisscoreTxt;
float alive = 0f;
bool isRunning = true;
public static gameManager I;
public GameObject endPanel;
void Awake()
{
I = this;
}
void Start()
{
InvokeRepeating("makeSquare", 0.0f, 0.7f);
}
// Update is called once per frame
void Update()
{
if (isRunning)
{
alive += Time.deltaTime;
timeTxt.text = alive.ToString("N2");
}
}
void makeSquare()
{
Instantiate(square);
}
public void gameOver()
{
isRunning = false;
Time.timeScale = 0f;
endPanel.SetActive(true);
thisscoreTxt.text = alive.ToString("N2");
endPanel.SetActive(true);
}
}
