포인터 입력을 처리할 때 컨트롤이 포인터를 캡처하기를 원할 수 있습니다.시각적 요소가 포인터를 캡처하면 Unity는 포인터가 시각적 요소 위에 있는지와 관계없이 포인터와 관련된 모든 이벤트를 시각적 요소로 전송합니다.예를 들어 드래그 이벤트를 수신하고 포인터를 캡처하는 컨트롤을 생성하면 포인터 위치와 관계없이 컨트롤이 드래그 이벤트를 계속 수신합니다.
Manipulator
클래스는 포인터를 캡처하는 손쉬운 방법을 제공합니다. Manipulator
클래스는 모든 매니퓰레이터에 대한 기본 클래스입니다. 매니퓰레이터는 포인터 입력을 처리하고 이벤트를 시각적 요소에 보내는 클래스입니다. 예를 들어 Clickable
클래스는 사용자가 시각적 요소를 클릭할 때 PointerDownEvent
를 보내는 매니퓰레이터입니다. PointerDownEvent
후에는 더 이상 요소 위에 커서를 올리지 않은 상태에서도 이후 발생하는 모든 포인터 이벤트를 수신할 수 있도록 일부 요소가 포인터 위치를 캡처해야 합니다. 예를 들어 버튼이나 슬라이더 또는 스크롤 바를 클릭하는 경우가 있습니다.
포인터를 캡처하려면 PointerCaptureHelper.CapturePointer
를 호출합니다.
포인터를 해제하려면 PointerCaptureHelper.ReleasePointer
를 호출합니다. CapturePointer()
를 호출할 때 다른 요소가 이미 포인터를 캡처하고 있다면, 요소는 PointerCaptureOutEvent
이벤트를 수신하고 캡처를 잃습니다.
애플리케이션에서 한 번에 하나의 요소만 캡처를 포함할 수 있습니다. 캡처가 있는 요소는 마우스 휠 이벤트를 제외한 모든 후속 포인터 이벤트의 타겟이 됩니다. 이는 아직 타겟이 설정되어 있지 않으며 디스패치 프로세스를 통해 타겟을 결정하는 포인터 이벤트에만 적용됩니다.
자세한 내용은 캡처 이벤트를 참조하십시오.
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.