RaptorLocalPlayers
Holds the local player that Logic moves, teleports and freezes.
| Namespace | Assembly | Kind | Stability |
|---|---|---|---|
Raptor.Components | Raptor.Components | class | preview, since 0.1.0 |
Holds one player. The slot is cleared at the start of every Play session, so register the player each time it is enabled.
public static class RaptorLocalPlayersProperties
Current
public static IRaptorLocalPlayer Current { get; }The registered player, or null if none is registered or it was destroyed.
Read it each time you need it instead of storing it.
Methods
Register
public static void Register(IRaptorLocalPlayer player)Makes player the local player. Null clears the slot. Call from the player's OnEnable.
| Parameter | Type | Description |
|---|---|---|
player | IRaptorLocalPlayer | The player to register. |
The last registration wins.
Unregister
public static void Unregister(IRaptorLocalPlayer player)Clears the slot if player holds it. Call from the player's OnDisable.
| Parameter | Type | Description |
|---|---|---|
player | IRaptorLocalPlayer | The player going away. |
Related types
- IRaptorLocalPlayer: Lets Logic use your own character as the player.