RaptorSuiteBrowsers
Opens browser windows that live outside RAPTOR, such as a game's door browser.
| Namespace | Assembly | Kind | Stability |
|---|---|---|---|
Raptor.EditorTools | Raptor.Editor | class | preview, since 0.1.0 |
The code that owns a browser window registers an opener under a key, usually from an [InitializeOnLoad] static constructor. RAPTOR's buttons and tool hooks call TryOpen. A key with no opener has its button hidden (IsRegistered), and TryOpen does nothing.
Keys are unique and compared ordinally after trimming. The first registration wins, so a registrant that runs twice keeps its first opener. A domain reload clears all openers and the registrants run again. Entering Play mode without a domain reload keeps them.
public static class RaptorSuiteBrowsersFields
Doors
public const string Doors;The door browser's key. The door Inspector shows a link to it.
Properties
Keys
public static IReadOnlyList<string> Keys { get; }A snapshot of every registered key, in registration order.
Version
public static int Version { get; }Incremented on every change.
Methods
IsRegistered
public static bool IsRegistered(string key)Whether an opener is registered for key.
| Parameter | Type | Description |
|---|---|---|
key | string | The browser's key. |
Returns: True when registered.
Register
public static bool Register(string key, Action open)Adds the opener for key. Throws on a blank key or a null opener.
| Parameter | Type | Description |
|---|---|---|
key | string | The browser's key. |
open | Action | Opens the browser. |
Returns: False when the key is already registered. The existing opener is kept.
Call from an [InitializeOnLoad] static constructor on the main thread.
TryOpen
public static bool TryOpen(string key)Opens the browser registered for key. An opener that throws is logged to the console.
| Parameter | Type | Description |
|---|---|---|
key | string | The browser's key. |
Returns: False when the key is not registered or the opener threw.
Events
Changed
public static event Action Changed;Raised after an opener is added, or removed by tests.