Sites

Menu

SpatialOSEntity Struct

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

Used to easily retrieve information about a SpatialOS Entity instance from a Unity ECS Entity instance.


Fields

SpatialOSEntityId Source
readonly EntityId SpatialOSEntityId


Methods

HasComponent<T> Source
bool HasComponent<T>()

Checks if this entity has a component of type T

Returns:
True, if the entity has the component; false otherwise.

Type parameters:
  • T : The SpatialOS component.
GetComponent<T> Source
T GetComponent<T>()

Gets a component of type T attached to this entity.

Returns:
The component T attached to this entity.

Type parameters:
  • T : The SpatialOS component.

Exceptions:
  • System.ArgumentException : Thrown if the component T is not attached to this entity.
TryGetComponent<T> Source
bool TryGetComponent<T>(out T component)

Attempts to get a component of type T attached to this entity.

Returns:
True, if the entity has the component; false otherwise.

Parameters
  • out T component : When this method returns, this will be the component attached to this entity if it exists; default constructed otherwise.

Type parameters:
  • T : The SpatialOS component.

Search results

Was this page helpful?

Thanks for letting us know!

Thanks for your feedback

Need more help? Ask on the forums