
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
어느 순간부터 gameManager.cs 의 invokeRepeating 이 동작하지 않습니다. 원인 불명!!
기억으로는 gameOver 적용 하면서 발생한 것 같은데 아직 해결이 안되고 있습니다.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class gameManager : MonoBehaviour
{
public GameObject food;
public GameObject dog;
public GameObject normalCat;
public GameObject fatCat;
public GameObject replayBtn;
public Text levelText;
public GameObject fishshop;
public GameObject levelFront;
public static gameManager I;
int level = 0;
int cat = 0;
private void Awake()
{
I = this;
}
// Start is called before the first frame update
void Start()
{
Time.timeScale = 1.0f;
InvokeRepeating("makeFood", 0.0f, 0.1f);
InvokeRepeating("makeCat", 0.0f, 1.0f);
}
void makeFood()
{
float x = dog.transform.position.x;
float y = dog.transform.position.y + 2.0f;
Instantiate(food, new Vector3(x,y,0), Quaternion.identity);
}
void makeCat()
{
Instantiate(normalCat);
if(level == 1)
{
float p = Random.Range(0, 10);
if (p < 2) Instantiate(normalCat);
}
else if (level == 2)
{
float p = Random.Range(0, 10);
if (p < 5) Instantiate(normalCat);
}
else if (level == 3)
{
float p = Random.Range(0, 10);
if (p < 6) Instantiate(normalCat);
Instantiate(fatCat);
}
}
public void gameOver()
{
}
// Update is called once per frame
void Update()
{
if (normalCat.transform.position.y == fishshop.transform.position.y)
{
replayBtn.SetActive(true);
Time.timeScale = 0f;
}
}
public void addCat()
{
cat += 1;
level = cat / 5;
}
}
