WorkerSystem Class

Namespace: Improbable.Gdk.CoreSource

A SpatialOS worker instance.

Inheritance

ComponentSystem


Fields

WorkerEntity Source
Entity WorkerEntity

An ECS entity that represents the Worker.

LogDispatcher Source
readonly ILogDispatcher LogDispatcher


WorkerType Source
readonly string WorkerType


WorkerId Source
readonly string WorkerId


Origin Source
readonly Vector3 Origin


IsConnected Source
bool IsConnected

Denotes whether the underlying worker is connected or not.

WorkerFlags Source
IReadOnlyDictionary<string, string> WorkerFlags


Constructors

WorkerSystem Source
WorkerSystem(WorkerInWorld worker)

Parameters


Methods

TryGetEntity Source
bool TryGetEntity(EntityId entityId, out Entity entity)

Attempts to find an ECS entity associated with a SpatialOS entity ID.

Returns:
True, if an ECS entity associated with the SpatialOS entity ID was found, false otherwise.

Parameters
  • EntityId entityId : The SpatialOS entity ID.
  • out Entity entity : When this method returns, contains the ECS entity associated with the SpatialOS entity ID if one was found, else the default value for Entity.

GetEntity Source
Entity GetEntity(EntityId entityId)

Parameters

HasEntity Source
bool HasEntity(EntityId entityId)

Checks whether a SpatialOS entity is checked out on this worker.

Returns:
True, if the SpatialOS entity is checked out on this worker, false otherwise.

Parameters
  • EntityId entityId : The SpatialOS entity ID to check for.

SendLogMessage Source
void SendLogMessage(string message, string loggerName, LogLevel logLevel, EntityId? entityId)

Parameters
  • string message :
  • string loggerName :
  • LogLevel logLevel :
  • EntityId? entityId :

GetWorkerFlag Source
string GetWorkerFlag(string key)

Gets the value for a given worker flag.

Returns:
The value of the flag, if it exists, null otherwise.

Parameters
  • string key : The key of the worker flag.

SendMetrics Source
void SendMetrics(Metrics metrics)

Parameters
  • Metrics metrics :


Overrides

OnCreate Source
override void OnCreate()


OnUpdate Source
override void OnUpdate()

Updated about a year ago


WorkerSystem Class


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.