Breakroom is now Sinewave Campus. Book a meeting

SNetworking

العميلالمكونات
في هذا الصنفSendEvent
  1. الدوال
  2. SendEvent
  3. ReceiveEvent
  4. الخصائص
  5. Enabled
  6. Instanced
  7. NetworkName
  8. Ready
  9. EventCount
  10. EventNames
  11. GameObject
الأعضاء 9
دالةSendEventSend a networking event event that will be received by other components in the scene with the same network name.
دالةReceiveEventInvoke an event on the networking component.
خاصيةEnabledWhether the simple networking component is Enabled or not
خاصيةInstancedReturns whether this networking component is instanced or not.
خاصيةNetworkNameReturns or sets the name of the network.
خاصيةReadyReturn whether the networking component is ready to send or not (is initialized).
خاصيةEventCountReturn the number of events this component is waiting to receive.
خاصيةEventNamesReturn a list of names of events that this component will receive.
خاصيةGameObject–

الدوال​

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.

المعاملات

الاسمالنوعالقيمة الافتراضية
eventNamestring–

القيم المرجعة

void

مثال

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.

المعاملات

الاسمالنوعالقيمة الافتراضية
eventNamestring–

القيم المرجعة

void

مثال

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

الخصائص​

Enabled​

bool Enabled {get; set; }

Whether the simple networking component is Enabled or not

مثال

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

Instancedللقراءة فقط​

bool Instanced {get; }

Returns whether this networking component is instanced or not.

مثال

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.

مثال

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

Readyللقراءة فقط​

bool Ready {get; }

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

مثال

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

EventCountللقراءة فقط​

int EventCount {get; }

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

مثال

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

EventNamesللقراءة فقط​

string[] EventNames {get; }

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

مثال

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

GameObjectللقراءة فقط​

SGameObject GameObject {get; }

مثال

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