SNetworking
في هذا الصنفSendEvent
| دالة | SendEvent | Send a networking event event that will be received by other components in the scene with the same network name. |
| دالة | ReceiveEvent | Invoke an event on the networking component. |
| خاصية | Enabled | Whether the simple networking component is Enabled or not |
| خاصية | Instanced | Returns whether this networking component is instanced or not. |
| خاصية | NetworkName | Returns or sets the name of the network. |
| خاصية | Ready | Return whether the networking component is ready to send or not (is initialized). |
| خاصية | EventCount | Return the number of events this component is waiting to receive. |
| خاصية | EventNames | Return a list of names of events that this component will receive. |
| خاصية | GameObject | – |
الدوال
SendEvent
Send a networking event event that will be received by other components in the scene with the same network name.
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| eventName | string | – |
القيم المرجعة
void
مثال
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.
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| eventName | string | – |
القيم المرجعة
void
مثال
Space.Host.ExecutingObject.Networking.ReceiveEvent("Light On")
الخصائص
Enabled
Whether the simple networking component is Enabled or not
مثال
Space.Host.ExecutingObject.Networking.Enabled = true
Instancedللقراءة فقط
Returns whether this networking component is instanced or not.
مثال
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.
مثال
Space.Host.ExecutingObject.Networking.NetworkName = "Example Network Name 1"
Readyللقراءة فقط
Return whether the networking component is ready to send or not (is initialized).
مثال
isReady = Space.Host.ExecutingObject.Networking.Ready
EventCountللقراءة فقط
Return the number of events this component is waiting to receive.
مثال
count = Space.Host.ExecutingObject.Networking.EventCount
EventNamesللقراءة فقط
Return a list of names of events that this component will receive.
مثال
tableOfNames = Space.Host.ExecutingObject.Networking.EventNames
GameObjectللقراءة فقط
مثال
theGameObject = Space.Host.ExecutingObject.Networking.GameObject



