SNetworking
Dans cette classeSendEvent
| Fonction | SendEvent | Send a networking event event that will be received by other components in the scene with the same network name. |
| Fonction | ReceiveEvent | Invoke an event on the networking component. |
| Propriété | Enabled | Whether the simple networking component is Enabled or not |
| Propriété | Instanced | Returns whether this networking component is instanced or not. |
| Propriété | NetworkName | Returns or sets the name of the network. |
| Propriété | Ready | Return whether the networking component is ready to send or not (is initialized). |
| Propriété | EventCount | Return the number of events this component is waiting to receive. |
| Propriété | EventNames | Return a list of names of events that this component will receive. |
| Propriété | GameObject | – |
Fonctions
SendEvent
Send a networking event event that will be received by other components in the scene with the same network name.
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| eventName | string | – |
Valeurs de retour
void
Exemple
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.
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| eventName | string | – |
Valeurs de retour
void
Exemple
Space.Host.ExecutingObject.Networking.ReceiveEvent("Light On")
Propriétés
Enabled
Whether the simple networking component is Enabled or not
Exemple
Space.Host.ExecutingObject.Networking.Enabled = true
InstancedLecture seule
Returns whether this networking component is instanced or not.
Exemple
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.
Exemple
Space.Host.ExecutingObject.Networking.NetworkName = "Example Network Name 1"
ReadyLecture seule
Return whether the networking component is ready to send or not (is initialized).
Exemple
isReady = Space.Host.ExecutingObject.Networking.Ready
EventCountLecture seule
Return the number of events this component is waiting to receive.
Exemple
count = Space.Host.ExecutingObject.Networking.EventCount
EventNamesLecture seule
Return a list of names of events that this component will receive.
Exemple
tableOfNames = Space.Host.ExecutingObject.Networking.EventNames
GameObjectLecture seule
Exemple
theGameObject = Space.Host.ExecutingObject.Networking.GameObject



