Get SpatialOS

Sites

Menu

Worker Class

Namespace: Improbable.Gdk.Core
GDK package: Core
Source

Represents a SpatialOS worker.

Inheritance

IDisposable


Fields

Origin Source
readonly Vector3 Origin

The origin of the worker in global Unity space.
WorkerType Source
readonly string WorkerType

The type of the worker.
WorkerId Source
readonly string WorkerId

The worker ID.

Notes:
  • Unique for a given SpatialOS deployment.
LogDispatcher Source
ILogDispatcher LogDispatcher

The logger for this worker.


Properties

Connection Source
Connection Connection { get; }

The connection to the SpatialOS runtime.
World Source
World World { get; }

The ECS world associated with this worker.
OnDisconnect Source
Action<string> OnDisconnect { }

An event that triggers when the worker is disconnected.


Static Methods

CreateWorkerAsync Source
async Task<Worker> CreateWorkerAsync(ReceptionistConfig config, ConnectionParameters connectionParameters, ILogDispatcher logger, Vector3 origin)

Connects to the SpatialOS Runtime via the Receptionist service and creates a Worker object asynchronously.

Returns:
A Task to run this method asynchronously and retrieve the created Worker object upon connecting successfully.

Parameters
  • ReceptionistConfig config : The ReceptionistConfig object stores the configuration needed to connect via the Receptionist Service.
  • ConnectionParameters connectionParameters : The ConnectionParameters storing
  • ILogDispatcher logger : The logger used by this worker.
  • Vector3 origin : The origin of this worker in the local Unity space.
CreateWorkerAsync Source
async Task<Worker> CreateWorkerAsync(LocatorConfig parameters, ConnectionParameters connectionParameters, ILogDispatcher logger, Vector3 origin)

Connects to the SpatialOS Runtime via the Locator service and creates a Worker object asynchronously.

Returns:
A Task to run this method asynchronously and retrieve the created Worker object upon connecting successfully.

Parameters
  • LocatorConfig parameters :
  • ConnectionParameters connectionParameters : The ConnectionParameters storing
  • ILogDispatcher logger : The logger used by this worker.
  • Vector3 origin : The origin of this worker in the local Unity space.
CreateWorkerAsync Source
async Task<Worker> CreateWorkerAsync(AlphaLocatorConfig parameters, ConnectionParameters connectionParameters, ILogDispatcher logger, Vector3 origin)

Connects to the SpatialOS Runtime via the Alpha Locator service and creates a Worker object asynchronously.

Returns:
A Task to run this method asynchronously and retrieve the created Worker object upon connecting successfully.

Parameters
  • AlphaLocatorConfig parameters :
  • ConnectionParameters connectionParameters : The ConnectionParameters storing
  • ILogDispatcher logger : The logger used by this worker.
  • Vector3 origin : The origin of this worker in the local Unity space.


Methods

Dispose Source
void Dispose()

Search results

Was this page helpful?

Thanks for letting us know!

Thanks for your feedback

Need more help? Ask on the forums