GetPersistentListenerState(int)
Returns the execution state of a persistent listener.
읽는 시간 1분최근 업데이트: 한 달 전
Definition
- Type: Method
- Namespace: UnityEngine.Events
- Assembly: UnityEngine.CoreModule
public UnityEventCallState GetPersistentListenerState(int index)
Parameters
Index of the listener to query.
Returns
Type | Description |
|---|---|
| UnityEventCallState | Execution state of the persistent listener. |
Examples
using UnityEngine;using UnityEngine.Events;public class Example : MonoBehaviour{ public UnityEvent onAction; void Start() { // Prints out the details of all persistent events for (int i = 0; i < onAction.GetPersistentEventCount(); ++i) { var target = onAction.GetPersistentTarget(i); var method = onAction.GetPersistentMethodName(i); var state = onAction.GetPersistentListenerState(i); Debug.Log($"{target}:{method}({state})"); } }}