Version: 2020.3

UnityEventTools.RemovePersistentListener

切换到手册
public static void RemovePersistentListener (Events.UnityEventBase unityEvent, int index);
public static void RemovePersistentListener (Events.UnityEventBase unityEvent, Events.UnityAction call);
public static void RemovePersistentListener (Events.UnityEventBase unityEvent, Events.UnityAction_1 call);
public static void RemovePersistentListener (Events.UnityEventBase unityEvent, Events.UnityAction_2 call);
public static void RemovePersistentListener (Events.UnityEventBase unityEvent, Events.UnityAction_3 call);
public static void RemovePersistentListener (Events.UnityEventBase unityEvent, Events.UnityAction_4 call);

参数

unityEvent 要修改的事件。
index 要删除的索引(如果指定)。
call 要删除的函数(如果指定)。

描述

从事件中删除给定函数。

You can specify either the index of the listener function to remove, or the delegate type of the listener function to remove. If you specify the delegate type, this method removes all occurrences of that listener function from the event. If you specify the the index, this method only removes the listener function at the index specified.