RaptorPlaytest
The playtest provider registry.
| Namespace | Assembly | Kind | Stability |
|---|---|---|---|
Raptor.EditorTools | Raptor.Editor | class | preview, since 0.1.0 |
The registry is in memory only. Providers register from load hooks, so it is rebuilt on every domain reload and survives entering Play without one. A provider that throws is treated as taking over no scenes, with one warning per provider type.
public static class RaptorPlaytestProperties
AnyEnabled
public static bool AnyEnabled { get; }True when any provider is enabled.
HubScene
public static string HubScene { get; }The hub scene of the first provider that names one, or an empty string if none does.
Providers
public static IReadOnlyList<IRaptorPlaytestProvider> Providers { get; }A snapshot of the registered providers, in registration order.
Version
public static int Version { get; }Increases with every change to the registry.
Methods
Claims
public static bool Claims(string sceneName)True when any provider takes over Play in sceneName, whether or not it is enabled.
| Parameter | Type | Description |
|---|---|---|
sceneName | string | The scene's name. |
Returns: True when a provider lists the scene.
DesignScenes
public static string[] DesignScenes()All providers' design scenes, in registration order, without duplicates. Empty when no provider is registered.
Returns: The scene names.
IsRegistered
public static bool IsRegistered(string id)True when a provider with this id is registered.
| Parameter | Type | Description |
|---|---|---|
id | string | The provider's id. |
Returns: True when registered.
Register
public static bool Register(IRaptorPlaytestProvider provider)Adds provider. Returns false and changes nothing if its id is already registered. Throws ArgumentNullException for a null provider and ArgumentException for a blank id.
| Parameter | Type | Description |
|---|---|---|
provider | IRaptorPlaytestProvider | The provider. |
Returns: False when the id is already registered.
Call from an [InitializeOnLoad] static constructor on the main thread.
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.
Related types
- IRaptorPlaytestProvider: Takes over the editor's Play button in chosen scenes, for example to host a session and spawn your own player.