
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
게임을 실행시키면 오류가 뜨면서 고양이가 내려와도 retry버튼이 생기지 않아요..

작성한 코드 및 에러 메세지
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class gameManager : MonoBehaviour
{
public GameObject dog;
public GameObject food;
public GameObject nomalCat;
public GameObject retryBtn;
public static gameManager I;
void Awake()
{
I = this;
}
// Start is called before the first frame update
void Start()
{
InvokeRepeating("makefood", 0.0f, 0.2f);
InvokeRepeating("makecat", 0.0f, 1.0f);
}
// Update is called once per frame
void Update()
{
}
void makefood()
{
float x = dog.transform.position.x;
float y = dog.transform.position.y + 2.0f; // y의 위치보다 2 높게 지정
Instantiate(food,new Vector3(x,y,0), Quaternion.identity); // Quternion은 회전을 표현할 수 있는 데이터 타입
}
void makecat()
{
Instantiate(nomalCat);
}
public void gameOver()
{
retryBtn.SetActive(true);
Time.timeScale = 0.0f;
}
}
