Get RAPTOR

RaptorPlayerProfiles

The player profile registry.

NamespaceAssemblyKindStability
Raptor.EditorToolsRaptor.Editorclasspreview, since 0.1.0

The registry is in memory only. Profiles register from load hooks, so it is rebuilt on every domain reload and survives entering Play without one. If a profile member throws, the Project profile's value is used, with one warning per profile type.

public static class RaptorPlayerProfiles

Fields

BodyRadiusKey

public const string BodyRadiusKey;

The RaptorProjectSettings key for the body radius.

DefaultBodyRadius

public const float DefaultBodyRadius;

The built-in profile's body radius, 0.35 m.

DefaultEyeHeight

public const float DefaultEyeHeight;

The built-in profile's eye height, 1.6 m.

EyeHeightKey

public const string EyeHeightKey;

The RaptorProjectSettings key for the eye height.

MaxBodyRadius

public const float MaxBodyRadius;

The largest body radius, 1.5 m. Profile values are clamped to it.

MaxEyeHeight

public const float MaxEyeHeight;

The largest eye height, 3 m. Profile values are clamped to it.

MinBodyRadius

public const float MinBodyRadius;

The smallest body radius, 0.05 m. Profile values are clamped to it.

MinEyeHeight

public const float MinEyeHeight;

The smallest eye height, 0.3 m. Profile values are clamped to it.

PrefabKey

public const string PrefabKey;

The RaptorProjectSettings key for the prefab's GUID.

ProjectId

public const string ProjectId;

The id of the built-in profile, set in Project Settings → RAPTOR → Player.

Properties

Current

public static IRaptorPlayerProfile Current { get; }

The profile in use: the first registered one, or Project if none is registered.

CurrentBodyRadius

public static float CurrentBodyRadius { get; }

The current profile's body radius in metres, clamped.

CurrentEyeHeight

public static float CurrentEyeHeight { get; }

The current profile's eye height in metres, clamped.

CurrentFallbackIdleClip

public static AnimationClip CurrentFallbackIdleClip { get; }

The current profile's fallback idle clip, or null.

CurrentPrefab

public static GameObject CurrentPrefab { get; }

The current profile's prefab, or null for the mannequin.

HasProvider

public static bool HasProvider { get; }

True when project code has registered a profile. Project Settings → RAPTOR → Player is then read-only.

Profiles

public static IReadOnlyList<IRaptorPlayerProfile> Profiles { get; }

A snapshot of the registered profiles, in registration order. It does not include Project.

Project

public static IRaptorPlayerProfile Project { get; }

The built-in profile. It uses the humanoid prefab set in Project Settings → RAPTOR → Player, or the mannequin.

Version

public static int Version { get; }

Increases with every change to the registry.

Methods

IsRegistered

public static bool IsRegistered(string id)

True when a profile with this id is registered.

ParameterTypeDescription
idstringThe profile's id.

Returns: True when registered.

Register

public static bool Register(IRaptorPlayerProfile profile)

Adds profile. Returns false and changes nothing if its id is already registered. Throws ArgumentNullException for a null profile and ArgumentException for a blank id or the built-in id.

ParameterTypeDescription
profileIRaptorPlayerProfileThe profile.

Returns: False when the id is already registered.

Call from an [InitializeOnLoad] static constructor on the main thread.

SeatHead

public static Pose SeatHead(Pose rest, Pose clip)

The current profile's head pose for the idle bake. Returns clip if the profile throws.

ParameterTypeDescription
restPoseThe bone's rest pose.
clipPoseThe bone's pose in the idle clip.

Returns: The head pose to bake.

Events

Changed

public static event Action Changed;

Raised on the main thread after every change to the registry. A subscriber that throws is logged and the others still run.

  • RaptorProjectSettings: RAPTOR's per-project settings file and the section registry for Project Settings → RAPTOR.
  • IRaptorPlayerProfile: Sets the body, eye height and radius of the player the Player Reference shows.