-
카테고리
-
세부 분야
게임 프로그래밍
-
해결 여부
미해결
QuestSystemTest 마지막에서 실행에러가 났습니다!
22.03.07 12:35 작성 조회수 156
0
QuestSystemTest까지 만들고 유니티에서 실행했는데 아래와 같은 오류가 뜨면서 슬라임죽이는 퀘스트가 클리어가 안됩니다.
스페이스 눌렀을때 디버그가 뜨지도 않구요.
IndexOutOfRangeException: Index was outside the bounds of the array.
Quest.OnRegister () (at Assets/Script/Quest/Quest.cs:108)
QuestSystem.Register (Quest quest) (at Assets/Script/Quest/QuestSystem.cs:74)
QuestSystem.Awake () (at Assets/Script/Quest/QuestSystem.cs:62)
UnityEngine.GameObject:AddComponent()
QuestSystem:get_Instance() (at Assets/Script/Quest/QuestSystem.cs:27)
QuestSystemTest:Start() (at Assets/Script/Test/QuestSystemTest.cs:18)
버그 난 메시지 눌러보면
public static QuestSystem Instance
{
get
{
if(!isApplicationQuitting && instance == null)
{
instance = FindObjectOfType<QuestSystem>();
if(instance == null)
{
instance = new GameObject("Quest System").AddComponent<QuestSystem>(); <- 여기서 멈춥니다
DontDestroyOnLoad(instance.gameObject);
}
}
return instance;
}
}
어... 문제가 뭘까요?? 일단 에디터 상의 오류는 없었습니다
답변을 작성해보세요.
1
Developer G
지식공유자2022.03.10
수강해주셔서 감사합니다.
답변이 늦어 죄송합니다.
지금 에러를 보면
Quest.OnRegister () (at Assets/Script/Quest/Quest.cs:108)
Quest 스크립트의 OnRegister 함수에서 에러가 난다고 되어있어 그 부분을 봐야 문제 확인을 할 수 있을 것 같습니다.
답변 1