Breakroom is now Sinewave Campus. Book a meeting

SNetworking

ClientComponents
On this classSendEvent
  1. Functions
  2. SendEvent
  3. ReceiveEvent
  4. Properties
  5. Enabled
  6. Instanced
  7. NetworkName
  8. Ready
  9. EventCount
  10. EventNames
  11. GameObject
Members 9
FunctionSendEventSend a networking event event that will be received by other components in the scene with the same network name.
FunctionReceiveEventInvoke an event on the networking component.
PropertyEnabledWhether the simple networking component is Enabled or not
PropertyInstancedReturns whether this networking component is instanced or not.
PropertyNetworkNameReturns or sets the name of the network.
PropertyReadyReturn whether the networking component is ready to send or not (is initialized).
PropertyEventCountReturn the number of events this component is waiting to receive.
PropertyEventNamesReturn a list of names of events that this component will receive.
PropertyGameObject–

Functions​

SendEvent​

void SendEvent(string eventName)

Send a networking event event that will be received by other components in the scene with the same network name.

Parameters

NameTypeDefault
eventNamestring–

Returns

void

Example

Lua
Space.Host.ExecutingObject.Networking.SendEvent("Light On")

ReceiveEvent​

void ReceiveEvent(string eventName)

Invoke an event on the networking component. Normally not necessary to do manually, as this happens automatically when receiving a matching event over the network, but may be useful to initialize a state.

Parameters

NameTypeDefault
eventNamestring–

Returns

void

Example

Lua
Space.Host.ExecutingObject.Networking.ReceiveEvent("Light On")

Properties​

Enabled​

bool Enabled {get; set; }

Whether the simple networking component is Enabled or not

Example

Lua
Space.Host.ExecutingObject.Networking.Enabled = true

InstancedRead only​

bool Instanced {get; }

Returns whether this networking component is instanced or not.

Example

Lua
isInstanced = Space.Host.ExecutingObject.Networking.Instanced

NetworkName​

string NetworkName {get; set; }

Returns or sets the name of the network. Network name must be at least 20 characters long without trailing or leading spaces.

Example

Lua
Space.Host.ExecutingObject.Networking.NetworkName = "Example Network Name 1"

ReadyRead only​

bool Ready {get; }

Return whether the networking component is ready to send or not (is initialized).

Example

Lua
isReady = Space.Host.ExecutingObject.Networking.Ready

EventCountRead only​

int EventCount {get; }

Return the number of events this component is waiting to receive.

Example

Lua
count = Space.Host.ExecutingObject.Networking.EventCount

EventNamesRead only​

string[] EventNames {get; }

Return a list of names of events that this component will receive.

Example

Lua
tableOfNames = Space.Host.ExecutingObject.Networking.EventNames

GameObjectRead only​

SGameObject GameObject {get; }

Example

Lua
theGameObject = Space.Host.ExecutingObject.Networking.GameObject