Skip to main content

TeleportDefinitionNetworkMessenger

A class in Root.Township, the global namespace.

Network entity behaviour that syncs teleport start and end effects for its TeleportDefinitions, so other players see the origin and destination visuals.

Constructors​

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

Fields​

3 private and internal fields
MemberWhat it is
private MethodSyncStruct<TeleportDefinitionNetworkMessenger.TeleportDefinitionPositionPair> syncTeleportFromSync message for origin effects.
private MethodSyncStruct<TeleportDefinitionNetworkMessenger.TeleportDefinitionPositionPair> syncTeleportToSync message for destination effects.
private TeleportDefinition[] teleportDefinitionsTeleport definitions this messenger serves; messages refer to them by index.

Methods​

MemberWhat it is
override void Initialize()Links each teleport definition to this messenger and sets up the two sync messages.
void TeleportFrom(TeleportDefinition teleportDefinition, Vector3 startPosition)Sends the origin effect for a teleport definition at a position to the chunks.
void TeleportTo(TeleportDefinition teleportDefinition, Vector3 endPosition)Sends the destination effect for a teleport definition at a position to the chunks.
2 private and internal methods
MemberWhat it is
private void SyncTeleportFrom(IPlayer player, Stream stream, TeleportDefinitionNetworkMessenger.TeleportDefinitionPositionPair pair)Reads or writes a definition index and position; remote clients play that definition's origin effect there.
private void SyncTeleportTo(IPlayer player, Stream stream, TeleportDefinitionNetworkMessenger.TeleportDefinitionPositionPair pair)Reads or writes a definition index and position; remote clients play that definition's destination effect there.

Used in​

Members of other types that take, return or hold a TeleportDefinitionNetworkMessenger: