Table of Contents

Class UdonSharpEventSender

public abstract class UdonSharpEventSender : UdonSharpBehaviour
Inheritance
UdonSharpEventSender
Derived
Extension Methods

Fields

logEvents

Whether to log the events sent.

protected bool logEvents

Field Value

bool

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

name string

The event name.

_AddListener(UdonSharpBehaviour)

Add a listener to the event.

public void _AddListener(UdonSharpBehaviour callback)

Parameters

callback UdonSharpBehaviour

The 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

callback UdonSharpBehaviour

The callback listener.

eventName string

The 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.