index | 要查询的侦听器的索引。 |
UnityEventCallState 持久侦听器的执行状态。
返回持久侦听器的执行状态。
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})"); } } }