Class EventReceiver
Creates an event receiver that is used to receive events from an EventKey
public sealed class EventReceiver : EventReceiverBase<bool>, IDisposable
- Inheritance
-
objectEventReceiver
- Implements
- Inherited Members
- Extension Methods
Constructors
EventReceiver(EventKey, EventReceiverOptions)
Initializes a new instance of the EventReceiver class. Creates an event receiver, ready to receive broadcasts from the key.
public EventReceiver(EventKey key, EventReceiverOptions options = EventReceiverOptions.None)
Parameters
keyEventKeyThe event key to listen from
optionsEventReceiverOptionsOption flags
Methods
ReceiveAsync()
Awaits a single event
public Task ReceiveAsync()
Returns
ReceiveOne(params EventReceiverBase[])
Combines multiple receivers in one call and tries to receive the first available events among all the passed receivers
public static Task<EventData> ReceiveOne(params EventReceiverBase[] events)
Parameters
eventsEventReceiverBase[]The events you want to listen to
Returns
TryReceive()
Receives one event from the buffer, useful specially in Sync scripts
public bool TryReceive()
Returns
TryReceiveAll()
Receives all the events from the queue (if buffered was true during creations), useful mostly only in Sync scripts
public int TryReceiveAll()