Version: 2021.3
언어: 한국어

UnityEventBase.GetPersistentListenerState

매뉴얼로 전환
public Events.UnityEventCallState GetPersistentListenerState (int index);

파라미터

index Index of the listener to query.

반환

UnityEventCallState Execution state of the persistent listener.

설명

Returns the execution state of a persistent listener.

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})"); } } }