FindGameObjectWithTag, FindWithTag
difference between GameObject.FindGameObjectWithTag(Tag tag) and GameObject.FindWithTag(Tag tag)
i’ve been wondering what the difference between these 2 is. I’ve seen them both appear and they seem to do exactly the same. The best explaination i could come up with is that the code got rewritten and they didn’t remove the old function. Also there
discussions.unity.com
FindWithTag와 FindGameObjectWithTag가 다른가에 대해 찾아보았다. 둘 다 매개변수로 string tag를 받는다.
깃허브에 들어가 GameObject를 확인해보니 FindWithTag는 FindGameObjectWithTag를 리턴하므로 tag를 리턴한다.
FindGameObjectWithTag가 어떻게 동작하는지 내부코드는 공개되어있지 않아서 자세한 것은 알 수 없지만 둘이 똑같이 동작하는 것 같다.
-FindWithTag는 FindGameObjectWithTag를 리턴한다
'유니티 심화' 카테고리의 다른 글
Player 사망-Event 처리, 몬스터 사망 (0) | 2023.08.24 |
---|---|
몬스터 수정- 해시값 전달, 몬스터의 공격, 피격시 혈흔 효과, Player 수정 (0) | 2023.08.24 |
메카님 애니메이션 제어,내비게이션-길찾기, 유한상태머신(FSM) (0) | 2023.08.23 |
오디오, 코루틴으로 총구 효과 (0) | 2023.08.22 |
파티클 활용, 폭발, random texture,폭발력 적용(AddExplosionForce) (0) | 2023.08.21 |