Class UdonSharpEventSender
- Namespace
- JLChnToZ.VRC.Foundation
public abstract class UdonSharpEventSender : UdonSharpBehaviour
- Inheritance
-
UdonSharpEventSender
- Derived
- Extension Methods
Fields
logEvents
Whether to log the events sent.
protected bool logEvents
Field Value
namedTargets
public DataDictionary namedTargets
Field Value
- DataDictionary
targets
All callback listeners.
protected UdonSharpBehaviour[] targets
Field Value
- UdonSharpBehaviour[]
Methods
SendEvent(string)
Send an event to all targets.
protected void SendEvent(string name)
Parameters
namestringThe event name.
_AddListener(UdonSharpBehaviour)
Add a listener to the event.
public void _AddListener(UdonSharpBehaviour callback)
Parameters
callbackUdonSharpBehaviourThe callback listener.
_AddListener(UdonSharpBehaviour, string)
Add a listener to the event with a specific event name. The event will be sent when SendEvent(string) is called with the same event name.
public void _AddListener(UdonSharpBehaviour callback, string eventName)
Parameters
callbackUdonSharpBehaviourThe callback listener.
eventNamestringThe event name.
Remarks
This can reduces the number of event sent and improve performance when you have many events but only a few of them need to be listened, as the event will only be sent to the listeners that are interested in the event.