https://youtu.be/HyL75cETVx0?t=594

AI Detecting Player in Unity 2D - Tank game tutorial P8In this Unity 2020 tutorial we will learn about creating AIDetector that will be part of our AI system. It will be responsible for detecting if the player is...youtu.be


RaycastHit2D result = Physics2D.Raycast(transform.position, Target.position - transform.position, viewRadius, visibleLayer);

return (playerLayer & (1 << result.collider.gameObject.layer)) != 0;

์œ„ ์ฝ”๋“œ์—์„œย 1 << result.collider.gameObject.layer ์ด ๋…€์„์ด ๋ญ˜ ์˜๋ฏธํ•˜๋Š”์ง€ ๋ชจ๋ฅด๊ฒ ๋„ค์š”