• 카테고리

    질문 & 답변
  • 세부 분야

    게임 프로그래밍

  • 해결 여부

    미해결

UI_Inven_Item 을 불러오는 과정에서 자꾸 에러가 뜹니다.

21.10.27 01:18 작성 조회수 132

0

nityEngine.GameObject.GetComponentsInChildren[T] (System.Boolean includeInactive) (at <ca496b8c93454b2f9b9924292c19379f>:0)

UnityEngine.GameObject.GetComponentsInChildren[T] () (at <ca496b8c93454b2f9b9924292c19379f>:0)

Utill.FindChild[T] (UnityEngine.GameObject go, System.String name, System.Boolean recursive) (at Assets/Script/Utills/Utill.cs:44)

UI_Base.Bind[T] (System.Type type) (at Assets/Script/UI/UI_Base.cs:26)

UI_Inven.Init () (at Assets/Script/UI/Scene/UI_Inven.cs:17)

UI_Inven.Start () (at Assets/Script/UI/Scene/UI_Inven.cs:35)

 

 

요 에러가 자꾸 발생하네요..

Inven을 불러오고 거기에 스크립트까지 붙는건 확인을 했는데,

gridPanel을 불러오고, 아이템을 불러오는 과정에서 뭔가 에러가 있는거같아요..ㅠ

코드정리 파일 받아서 비교해보아도 이상한 부분이 없어서 도움 요청 드립니다.

답변 2

·

답변을 작성해보세요.

0

UI_Base의 Bind<T> 코드에서

if (type == typeof(GameObject))
이게 아니고

if (typeof(T) == typeof(GameObject))
이렇게 수정해주시면 됩니다.

adsf2235님의 프로필

adsf2235

질문자

2021.10.29

감사합니다!

0

위 내용만으로는 알 수 없지만,
프리팹에 문제가 있을 확률이 높습니다.
Bind를 할 대상의 이름이 일치하는지 확인해보세요.
그래도 정 해결이 힘들면 rookiss@naver.com로 전체 프로젝트 압축해서 보내주세요