SNetworking
On this classSendEvent
| Function | SendEvent | Send a networking event event that will be received by other components in the scene with the same network name. |
| Function | ReceiveEvent | Invoke an event on the networking component. |
| Property | Enabled | Whether the simple networking component is Enabled or not |
| Property | Instanced | Returns whether this networking component is instanced or not. |
| Property | NetworkName | Returns or sets the name of the network. |
| Property | Ready | Return whether the networking component is ready to send or not (is initialized). |
| Property | EventCount | Return the number of events this component is waiting to receive. |
| Property | EventNames | Return a list of names of events that this component will receive. |
| Property | GameObject | – |
Functions
SendEvent
Send a networking event event that will be received by other components in the scene with the same network name.
Parameters
| Name | Type | Default |
|---|---|---|
| eventName | string | – |
Returns
void
Example
Space.Host.ExecutingObject.Networking.SendEvent("Light On")
ReceiveEvent
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
| Name | Type | Default |
|---|---|---|
| eventName | string | – |
Returns
void
Example
Space.Host.ExecutingObject.Networking.ReceiveEvent("Light On")
Properties
Enabled
Whether the simple networking component is Enabled or not
Example
Space.Host.ExecutingObject.Networking.Enabled = true
InstancedRead only
Returns whether this networking component is instanced or not.
Example
isInstanced = Space.Host.ExecutingObject.Networking.Instanced
NetworkName
Returns or sets the name of the network. Network name must be at least 20 characters long without trailing or leading spaces.
Example
Space.Host.ExecutingObject.Networking.NetworkName = "Example Network Name 1"
ReadyRead only
Return whether the networking component is ready to send or not (is initialized).
Example
isReady = Space.Host.ExecutingObject.Networking.Ready
EventCountRead only
Return the number of events this component is waiting to receive.
Example
count = Space.Host.ExecutingObject.Networking.EventCount
EventNamesRead only
Return a list of names of events that this component will receive.
Example
tableOfNames = Space.Host.ExecutingObject.Networking.EventNames
GameObjectRead only
Example
theGameObject = Space.Host.ExecutingObject.Networking.GameObject



