Custom Collider 2D는 2D 물리 시스템과 상호 작용하는 콜라이더입니다. 다른 콜라이더와 달리 콜라이더 인에디터를 설정하지 않고 PhysicsShapeGroup2D API를 통해 PhysicsShape2D 지오메트리를 할당하여 콜라이더를 설정합니다. PhysicsShape2D
모양을 추가, 제거 및 수정하여 콜라이더를 추가로 정의할 수 있습니다. 자세한 내용은 PhysicsShape2D API 문서를 참조하십시오. 또한 이것은 커스텀 콜라이더 2D가 낮은 수준의 PhysicsShape2D
를 무제한으로 포함하고 모든 타입의 모양을 나타내거나 다른 타입의 Collider 2D를 에뮬레이트할 수 있음을 의미합니다.
커스텀 콜라이더 2D에 PhysicsShape2D
를 할당할 때 편집 모드나 플레이 모드 중에도 할당할 수 있습니다. 편집 모드에서 커스텀 콜라이더 2D를 수정할 때 Unity는 할당된 모든 PhysicsShape2D
와 관련 버텍스를 Unity 씬에 저장하고 CustomCollider2D
는 씬이 로드될 때 설정을 유지합니다. 이렇게 하면 편집 모드 저작 스크립트를 사용하여 커스텀 지오메트리를 생성할 수 있습니다.
플레이 모드에서 커스텀 콜라이더 2D를 수정할 때 콜라이더는 할당된 PhysicsShape2D
와 관련 버텍스에 대한 어떤 변경 사항도 유지하지 않으며 플레이 모드를 종료하면 모든 변경 사항이 손실됩니다.
프로퍼티 | 기능 |
---|---|
Density | 리지드바디 2D와 연관된 게임 오브젝트의 질량 계산을 바꾸려면 Density 값을 변경합니다. 해당 값을 0으로 설정하면 관련 리지드바디 2D는 질량 중심 계산을 포함한 모든 질량 계산에 해당하는 콜라이더 2D를 무시합니다. 참고: 이 프로퍼티는 게임 오브젝트에 연결된 Rigidbody 2D 컴포넌트에 있는 Use Auto Mass가 활성화된 경우에만 사용할 수 있습니다. |
Material | 마찰이나 바운스와 같은 충돌과 관련된 속성을 결정하는 물리 머리티얼 2D. |
Is Trigger | 커스텀 콜라이더 2D가 트리거로 작동하도록 하려면 이 프로퍼티를 활성화합니다(트리거 사용에 대한 자세한 내용은 콜라이더 개요 참조). |
Used By Effector | 커스텀 콜라이더 2D가 연결된 Effector 2D 컴포넌트에 의해 사용되길 원할 경우 이 프로퍼티를 활성화합니다. |
Offset | 콜라이더 2D 지오메트리의 로컬 오프셋 값을 설정합니다. |
Custom Shape Count (Read Only) | 콜라이더에서 사용 중인 PhysicsShape2D 의 수를 나타냅니다. |
Custom Vertex Count (Read Only) | 콜라이더에서 모든 PhysicsShape2D 가 사용 중인 버텍스의 수를 나타냅니다. |
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.