
문제1. RetryBtn에 Button Component에 Target Graphic에 설정이 안되요.
Hierarchy의 retryBtn이나, Project의 retryBtn등 다 드래그앤 드랍을 해봐도 올라가지지 않습니다 ㅜㅜ
문제2. 게임 종료 후, retryBtn을 눌렀을때, MainScene이 실행이 안됩니다.
아예 눌러지는 모션이 없어서 눌리고 있는건지 아닌건지 확인이 안되고, 눌러도 넘어가지를 않네요.

retryBtn.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class retryBtn : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
public void ReGame()
{
SceneManager.LoadScene("MainScene");
}
}
gameManager.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class gameManager : MonoBehaviour
{
public GameObject food;
public GameObject dog;
public GameObject normalCat;
public static gameManager I;
public GameObject retryBtn;
public void gameOver()
{
retryBtn.SetActive(true);
Time.timeScale = 0.0f;
}
void Awake()
{
I = this;
}
void Start()
{
InvokeRepeating("makeFood", 0.0f, 0.2f);
InvokeRepeating("makeCat", 0.0f, 1.0f);
}
void makeFood()
{
float x = dog.transform.position.x; // dog의 위치를 기준으로 만들어주는 것
float y = dog.transform.position.y + 2.0f;
Instantiate(food, new Vector3(x,y,2), Quaternion.identity); //quaternion은 회전을 표현할 수 있는 데이터 타입
}
void makeCat()
{
Instantiate(normalCat);
}
// Update is called once per frame
void Update()
{
}
}
