이벤트 시스템은 키보드, 마우스, 터치, 커스텀 입력 등 입력 기반 애플리케이션의 오브젝트에 이벤트를 전송하는 방법입니다. 이벤트 시스템은 이벤트를 전송에 함께 작용하는 일부 컴포넌트로 구성됩니다.
이벤트 시스템(Event System) 컴포넌트를 게임 오브젝트에 추가할 때 이벤트 시스템 자체가 이벤트 시스템 모듈 사이에서 커뮤니케이션에 매니저 및 퍼실리테이터로 설계되어 있기 때문에 많은 기능이 노출되지 않습니다.
이벤트 시스템의 주요 역할은 다음과 같습니다.
입력 모듈은 이벤트 시스템을 어떻게 생생하게 동작하게 할지에 대한 메인 로직으로, 다음에 사용됩니다.
한 번에 한 입력 모듈만 이벤트 시스템에 활성화할 수 있으며 Event System 컴포넌트로 동일 게임 오브젝트의 컴포넌트여야 합니다.
커스텀 입력 모듈을 작성하려는 경우 Unity에서 기존 UI 컴포넌트가 지원하는 이벤트를 전송하십시오. 자체 이벤트를 확장하고 작성하려면 메시징 시스템 문서를 참조하십시오.
레이캐스터(Raycasters)는 포인터가 가리키는 것을 계산하는 데 사용되며, 일반적으로 입력 모듈이 포인팅 디바이스가 무엇 위에 있는지 산출하는 씬과 관련된 레이캐스터를 사용합니다.
다음 3개의 레이캐스터가 기본값으로 제공됩니다.
씬에 설정된 2D / 3D 레이캐스터가 있는 경우, UI가 아닌 요소가 입력 모듈에서 메시지를 수신하도록 쉽게 설정할 수 있습니다.이벤트 인터페이스 중 하나를 구현하는 스크립트를 연결하기만 하면 됩니다.이와 관련된 예시는 IPointerEnterHandler와 IPointerClickHandler 스크립팅 레퍼런스 페이지를 참조하십시오.
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.