Legacy Documentation: Version 4.6.2
Language: English
  • C#
  • JS
  • Boo

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Events.UnityEventTools.AddPersistentListener

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public static function AddPersistentListener(unityEvent: UnityEventBase): void;
public static void AddPersistentListener(UnityEventBase unityEvent);
public static def AddPersistentListener(unityEvent as UnityEventBase) as void
public static function AddPersistentListener(unityEvent: UnityEvent, call: UnityAction): void;
public static void AddPersistentListener(UnityEvent unityEvent, UnityAction call);
public static def AddPersistentListener(unityEvent as UnityEvent, call as UnityAction) as void
public static function AddPersistentListener(unityEvent: UnityEvent<T0>, call: UnityAction<T0>): void;
public static void AddPersistentListener(UnityEvent<T0> unityEvent, UnityAction<T0> call);
public static def AddPersistentListener(unityEvent as UnityEvent<T0>, call as UnityAction<T0>) as void
public static function AddPersistentListener(unityEvent: UnityEvent<T0,T1>, call: UnityAction<T0,T1>): void;
public static void AddPersistentListener(UnityEvent<T0,T1> unityEvent, UnityAction<T0,T1> call);
public static def AddPersistentListener(unityEvent as UnityEvent<T0,T1>, call as UnityAction<T0,T1>) as void
public static function AddPersistentListener(unityEvent: UnityEvent<T0,T1,T2>, call: UnityAction<T0,T1,T2>): void;
public static void AddPersistentListener(UnityEvent<T0,T1,T2> unityEvent, UnityAction<T0,T1,T2> call);
public static def AddPersistentListener(unityEvent as UnityEvent<T0,T1,T2>, call as UnityAction<T0,T1,T2>) as void
public static function AddPersistentListener(unityEvent: UnityEvent<T0,T1,T2,T3>, call: UnityAction<T0,T1,T2,T3>): void;
public static void AddPersistentListener(UnityEvent<T0,T1,T2,T3> unityEvent, UnityAction<T0,T1,T2,T3> call);
public static def AddPersistentListener(unityEvent as UnityEvent<T0,T1,T2,T3>, call as UnityAction<T0,T1,T2,T3>) as void

Parameters

unityEvent Event to modify.
call Function to call.

Description

Adds a persistent, call to the listener. Will be invoked with the arguments as defined by the Event and sent from the call location.