Get RAPTOR

RaptorEntityBodyProviders

The priority registry of entity body providers.

NamespaceAssemblyKindStability
Raptor.EditorToolsRaptor.Editorclasspreview, since 0.1.0

The built-in providers are always registered with priority BuiltInPriority. CoreId supplies Static and Dynamic, and BasicPhysicsId supplies the basic Physics body (RaptorBasicPhysicsBody, a Rigidbody and a convex hull per part). There is no built-in Breakable body; without a game provider, Breakable has no segment. A game provider registers from an [InitializeOnLoad] class with a higher priority and wins the bodies it supplies.

Resolved is rebuilt on the first read after a change, so registration order across assemblies does not matter. Registering invalidates the Suite's chrome cache. Providers are held in memory and registered again on every domain reload.

public static class RaptorEntityBodyProviders

Fields

BasicPhysicsId

public const string BasicPhysicsId;

The id of RAPTOR's basic Physics body provider.

BuiltInPriority

public const int BuiltInPriority;

The priority of RAPTOR's built-in providers (0).

CoreId

public const string CoreId;

The id of RAPTOR's core provider (Static and Dynamic).

Properties

All

public static IReadOnlyList<RaptorEntityBodyProvider> All { get; }

Gets a snapshot of every registered provider in registration order, built-ins first.

Version

public static int Version { get; }

Gets a counter that increases by one on every change.

Methods

IsRegistered

public static bool IsRegistered(string id)

Whether a provider with this id is registered.

ParameterTypeDescription
idstringThe provider's id.

Returns: True when registered.

ProviderOf

public static RaptorEntityBodyProvider ProviderOf(RaptorEntityBody body)

Returns the provider whose option is used for body, or null if no provider supplies it.

ParameterTypeDescription
bodyRaptorEntityBodyThe body.

Returns: The provider, or null.

Register

public static bool Register(RaptorEntityBodyProvider provider)

Adds provider. Returns false and keeps the existing provider when its id is already registered. Throws ArgumentNullException for null and ArgumentException for a blank id.

ParameterTypeDescription
providerRaptorEntityBodyProviderThe provider.

Returns: False when the id is taken.

Call from an [InitializeOnLoad] static constructor on the main thread. A callback that throws is logged and does not stop the others.

Events

Changed

public static event Action Changed;

Raised after every change.