ComponentSignal¶
Type
ComponentSignal is a world-wide signal on a component handle, such as Component.User.Added, Component.User.Removed, or Component.Button.Clicked. Handlers receive the entity first followed by any signal payload arguments. To listen on one entity, pass the same handle to entity:On(signal, fn).
Connect¶
Connect runs fn every time the signal fires on any entity, passing the entity followed by the payload values, and returns a Connection.
Example
Once¶
Once runs fn the next time the signal fires on any entity, then disconnects it, and returns a Connection.
Example
Wait¶
Wait yields until the signal next fires on any entity or seconds pass, returning true, the entity, and the payload values on fire, or false on timeout.