new UEventDispatcher(opt)
| Name | Type | Default | Description |
|---|---|---|---|
opt |
UEventDispatcher~UEventDispatcherCO | {} | optional |
Methods
-
dispatchEvent(event, data)
-
이벤트를 발생시키는 메서드
Name Type Description eventstring | UEventDispatcher~DispatchInputEvent 이벤트 타입
dataany optional 이벤트 함수로 넘길 데이터
-
emit(event, data)
-
Name Type Description eventstring | UEventDispatcher~DispatchInputEvent dataany optional -
hasEventListener(type, listener)boolean
-
이벤트 등록 여부를 반환하는 메서드
Name Type Description typestring 이벤트 타입
listenerEventCallBack | string 이벤트 함수 또는 함수 ID
Returns:
Type Description boolean 등록 여부. true면 등록됨, false면 등록 안됌 -
hasEventType(type)boolean
-
이벤트 타입이 등록되어 있는지 확인하는 메서드
Name Type Description typestring 이벤트 타입
Returns:
Type Description boolean 등록 여부 -
off(type, listener)
-
이벤트 제거 메서드
Name Type Description typestring optional 이벤트 타입
listenerfunction | string optional 이벤트 함수 또는 ID
-
on(type, listener, once, name)string|null
-
Name Type Default Description typestring 이벤트 타입
listenerEventCallBack 이벤트 함수
onceboolean | undefined false optional 한번만 동작할지 여부. true면 1회 동작
namestring | undefined optional 이벤트 함수 식별 이름 (ID)
Returns:
Type Description string | null 등록된 이벤트 함수 식별 이름. 등록 실패 시 null 반환 -
once(type, listener, name)string|null
-
1회만 동작하는 이벤트를 등록하는 메서드
Name Type Description typestring 이벤트 타입
listenerEventCallBack 이벤트 함수
namestring optional 이벤트 함수 식별 이름 (ID)
Returns:
Type Description string | null 등록된 이벤트 함수 식별 이름. 등록 실패 시 null 반환 -
unkey(type, key)
-
이벤트 명시적 해제 메서드
Name Type Description typestring 이벤트 타입
keystring optional 이벤트 함수 ID
Type Definitions
-
DispatchInputEventobject
-
이벤트를 디스패치 할때의 입력 객체 인터페이스 입니다.
Properties:
Name Type Argument Description typestring 이벤트 타입
dataany <optional>
디스패치 데이터
targetUEventDispatcher | undefined | null <optional>
디스패치 발생 객체
-
UEventDispatcherCOobject
-
UEventDispatcher 생성자 옵션 입니다.