
4-9 카드 매칭하기 단계에서 card.cs에
if문 구절에서 null값만 넣으면 자꾸 오류가 떠요
강의자료에 있는 코드를 복붙해도 안 되고
card 프리팹을 삭제하고 다시 만들어도 안 되고 이유를 모르겠네요...
버전은 2022.1.21f1 버전 사용하고 있습니다

카드를 클릭해서 뒤집으면 저렇게 오류가 떠요
작성한 코드 및 에러 메세지
public void openCard()
{
anim.SetBool("isOpen", true);
transform.Find("front").gameObject.SetActive(true);
transform.Find("back").gameObject.SetActive(false);
}
여기까지는 잘 실행이 되는데,
public void openCard()
{
anim.SetBool("isOpen", true);
transform.Find("front").gameObject.SetActive(true);
transform.Find("back").gameObject.SetActive(false);
if (gameManager.I.firstCard == null)
{
gameManager.I.firstCard = gameObject;
}
else
{
gameManager.I.secondCard = gameObject;
gameManager.I.isMatched();
}
}
if문 추가해주고 나서 오류가 나요!
