Polygon Collider 2D 컴포넌트는 2D 물리와 함께 사용하는 콜라이더입니다. 콜라이더의 형태는 라인 세그먼트로 구성되는 프리폼 에지로 정의되므로, 스프라이트 그래픽스의 형태에 맞게 매우 정밀하게 조정할 수 있습니다. 이 콜라이더의 에지는 (유사한 Edge Collider 2D와 달리) 한 영역을 완전히 둘러싸야 합니다.
프로퍼티 | 기능 |
---|---|
Material | 마찰이나 바운스와 같은 충돌 프로퍼티를 결정하는 물리 머티리얼입니다. |
Is Trigger | 콜라이더를 트리거로 사용하려면 이 박스를 선택해야 합니다. |
Used by Effector | 연결된 이펙터에서 콜라이더가 사용되는지 여부를 설정합니다. |
Used by Composite | 콜라이더가 연결된 Composite Collider 2D에서 사용되도록 하려면 이 체크박스를 선택해야 합니다. 복합에서 사용(Used by Composite) 을 활성화하면, 다른 프로퍼티는 연결된 복합 콜라이더 2D에서 제어되기 때문에 Polygon Collider 2D 컴포넌트에서 사라집니다. 박스 콜라이더 2D에서 사라지는 프로퍼티는 머티리얼(Material), 트리거(Is Trigger), 이펙터에서 사용(Used By Effector), 모서리 반지름(Edge Radius) 입니다. |
Used by Collider | 연결된 Composite Collider 2D 컴포넌트에서 박스 콜라이더 2D가 사용되도록 하려면 상자를 선택합니다. |
Auto Tiling | Sprite Renderer 컴포넌트의 Draw Mode 를 Tiled 로 설정한 경우 이 확인란을 선택합니다. 그러면 콜라이더 2D 형태의 자동 업데이트가 가능합니다. 즉, 스프라이트의 면적이 변경되면 형태가 자동으로 재조정됩니다. Auto Tiling 을 활성화하지 않으면 스프라이트의 크기가 변해도 콜라이더 2D가 동일한 형태와 크기로 유지됩니다. |
Offset | 콜라이더 지오메트리의 로컬 오프셋입니다. |
Points | 생성된 콜라이더의 복잡성에 대한 편집할 수 없는 정보입니다. |
콜라이더는 수동으로 편집할 수 있지만, Unity가 모양을 자동으로 결정할 수 있도록 하면 더 편리한 경우가 많습니다. 이렇게 하려면 프로젝트 뷰에서 스프라이트 에셋을 인스펙터의 Polygon Collider 2D 컴포넌트로 드래그해야 합니다.
인스펙터의 Edit Collider 버튼을 눌러 폴리곤 모양을 편집할 수 있습니다. Edit Collider 콜라이드 편집 모드를 종료할 수 있습니다. 편집 모드에서 마우스가 기존 버텍스 위에 있을 때 해당 버텍스를 드래그하여 이동할 수 있습니다. 마우스가 에지 위에 있을 때 shift를 누른 채로 드래그하면 마우스가 있는 위치에 새 버텍스가 생성됩니다. ctrl/cmd를 누른 상태에서 버텍스를 클릭하여 제거할 수 있습니다.
콜라이더 편집 중에 2D 이동 기즈모의 아웃라인을 숨길 수 있습니다. 인스펙터에서 Sprite Renderer 컴포넌트의 폴드아웃 화살표만 클릭하면 됩니다.
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.