
마지막 단계, 패널이 뜨고 누르면 멈추는 것까지만 가능하네요.
다시 시작이 안됩니다ㅜㅜ
어떤거에서 문제인지 모르겠어요
틀린 문법도 없어보이고
오류도 안뜨고
panel의 클릭 뭐시기 설정부분에서 retry가 조금 달라서 이거 문제인가 싶었는데 다른 방안이 없는 것 같더군요
도와주세요..
보고 계신 화면




전체를 캡처해 주시면, 튜터님들이 빠르게 상황을 이해할 수 있어요.
작성한 코드 및 에러 메세지
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class GameManager : MonoBehaviour
{
public GameObject Rain;
public GameObject Panel;
public static GameManager I;
public Text scoreText;
public Text timeText;
int totalScore;
float limit = 5f;
void Awake()
{
I = this;
}
// Start is called before the first frame update
void Start()
{
initGame();
InvokeRepeating("makeRain", 0, 0.5f);
}
// Update is called once per frame
void Update()
{
limit -= Time.deltaTime;
if (limit < 0)
{
limit = 0.0f;
Panel.SetActive(true);
Time.timeScale = 0.0f;
}
timeText.text = limit.ToString("N2");
}
void makeRain()
{
Instantiate(Rain);
}
public void addScore(int score)
{
totalScore += score;
scoreText.text = totalScore.ToString();
}
public void retry()
{
SceneManager.LoadScene("MainScene");
}
void initGame()
{
Time.timeScale = 1.0f;
totalScore = 0;
limit = 5f;
}
}
