
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
작성한 코드 및 에러 메세지
using System.Collections;
using System.Collections.Generic;
using System.Xml.Schema;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class GameManager : MonoBehaviour
{
public static GameManager Instance;
public GameObject rain;
public Text TotalScoreTxt;
public Text TimeTxt;
public GameObject EndPanel;
int Totalscore;
float TotalTime = 30.0f;
private void Awake()
{
Instance = this;
}
// Start is called before the first frame update
void Start()
{
InvokeRepeating("MakeRain", 0f, 1f);
}
// Update is called once per frame
void Update()
{
if (TotalTime > 0f)
{
TotalTime -= Time.deltaTime;
}
else
{
TotalTime = 0f;
EndPanel.SetActive(true);
Time.timeScale = 0f;
}
TimeTxt.text = TotalTime.ToString("N2");
}
void MakeRain()
{
Instantiate(rain);
}
public void AddScore(int score)
{
Totalscore += score;
TotalScoreTxt.text = Totalscore.ToString();
}
public void Retry()
{
SceneManager.LoadScene("MainScene");
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RetryButton : MonoBehaviour
{
public void Retry()
{
GameManager.Instance.Retry();
}
}
