Get RAPTOR

RaptorLocalPlayers

Holds the local player that Logic moves, teleports and freezes.

NamespaceAssemblyKindStability
Raptor.ComponentsRaptor.Componentsclasspreview, 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 RaptorLocalPlayers

Properties

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.

ParameterTypeDescription
playerIRaptorLocalPlayerThe 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.

ParameterTypeDescription
playerIRaptorLocalPlayerThe player going away.