Struct UnityCheckpointRespawnPose
The data a UnityCheckpointTriggerComponent saves with its checkpoint: the world position and rotation a respawn puts the player back at, as UTF-8 JSON. A respawn script loads the checkpoint and reads its data back with TryRead(byte[], out UnityCheckpointRespawnPose).
Inherited Members
Namespace: Serenity.Checkpoint.Infrastructure.Components
Assembly: Serenity.UnityCheckpoint.Infrastructure.dll
Syntax
public struct UnityCheckpointRespawnPose
Constructors
UnityCheckpointRespawnPose(Vector3, Quaternion)
Describes where a respawn puts the player back.
Declaration
public UnityCheckpointRespawnPose(Vector3 position, Quaternion rotation)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | position | The world position. |
| Quaternion | rotation | The world rotation. |
Properties
Position
The world position a respawn puts the player back at.
Declaration
public Vector3 Position { get; }
Property Value
| Type | Description |
|---|---|
| Vector3 |
Rotation
The world rotation a respawn puts the player back at.
Declaration
public Quaternion Rotation { get; }
Property Value
| Type | Description |
|---|---|
| Quaternion |
Methods
ToBytes()
The pose as the checkpoint data a checkpoint trigger saves.
Declaration
public byte[] ToBytes()
Returns
| Type | Description |
|---|---|
| byte[] | UTF-8 JSON. |
TryRead(byte[], out UnityCheckpointRespawnPose)
Reads the pose back from checkpoint data a checkpoint trigger saved.
Declaration
public static bool TryRead(byte[] data, out UnityCheckpointRespawnPose pose)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | data | The checkpoint's data. |
| UnityCheckpointRespawnPose | pose | The pose, or the default pose when the data is not one. |
Returns
| Type | Description |
|---|---|
| bool | True when |