Class UnityGameObject
A class representing an Unity GameObject.
Inherited Members
Namespace: Microsoft.XboxStudios.GameStateTracker.Unity
Assembly: GameStateTracker.Unity.dll
Syntax
[GameClass("GameObject")]
[GameProperty(new string[] { "Transform.position", "Transform.rotation" })]
public class UnityGameObject : UnityObject, IGameObject, INotifyPropertyChanged, IUnityGameObject, IUnityObject
Remarks
Initializes a new instance of the UnityGameObject class.
Constructors
View SourceUnityGameObject(IGameObject)
A class representing an Unity GameObject.
Declaration
public UnityGameObject(IGameObject gameObject)
Parameters
Type | Name | Description |
---|---|---|
IGameObject | gameObject | The game object to encapsulate. |
Remarks
Initializes a new instance of the UnityGameObject class.
Properties
View SourcePosition
Gets the cached game object's position.
Declaration
public virtual Vector3? Position { get; }
Property Value
Type | Description |
---|---|
Vector3? |
Rotation
Gets the cached game object's rotation.
Declaration
public virtual Quaternion? Rotation { get; }
Property Value
Type | Description |
---|---|
Quaternion? |
Methods
View SourceGetPosition(TimeSpan)
Gets the game object's position.
Declaration
public virtual Task<Vector3?> GetPosition(TimeSpan maxAge)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | maxAge | The maximum age of the game object, if it exists in the cache. |
Returns
Type | Description |
---|---|
Task<Vector3?> | A position vector. |
GetRotation(TimeSpan)
Gets the game object's rotation.
Declaration
public virtual Task<Quaternion?> GetRotation(TimeSpan maxAge)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | maxAge | The maximum age of the game object, if it exists in the cache. |
Returns
Type | Description |
---|---|
Task<Quaternion?> | A quaternion that represents Unity's rotation. |