Skip to main content

NetworkedEvent

A class in Root.Township, the global namespace.

Network entity that fires a Unity event on the server and every client when the server calls Trigger.

Constructors​

MemberWhat it is
NetworkedEvent()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

4 private and internal fields
MemberWhat it is
private bool isClientOnlyIf true, the server doesn't fire the event itself, except in local test.
private EntityMessageType messageTypeEntity message type used, so several of these can sit on one entity.
private MethodSync syncThe method sync.
private AltaEvent triggeredEvent fired when triggered.

Methods​

MemberWhat it is
override void Initialize()Creates the sync message with the chosen message type.
void Trigger()Server: fires the event locally (unless client only) and sends it to nearby chunks.
1 private and internal method
MemberWhat it is
private void Sync(IPlayer player, Stream stream)Fires the event on clients when the message arrives.