RaptorBlockModifiers
The registry of IRaptorBlockModifiers.
| Namespace | Assembly | Kind | Stability |
|---|---|---|---|
Raptor.EditorTools | Raptor.Editor | class | preview, since 0.1.0 |
Modifiers are discovered through TypeCache on the first read of All. Discovery does not depend on [InitializeOnLoad] order, so a build during a domain reload sees every modifier. It is not reset on entering Play mode, so it also works with domain reload disabled. A modifier that throws is reported once per Id and Block, and that Block builds from its cage.
public static class RaptorBlockModifiersProperties
All
public static IReadOnlyList<IRaptorBlockModifier> All { get; }Every modifier, sorted by Order then Id.
Version
public static int Version { get; }Changes whenever All changes. Use it as a cache key.
Methods
Register
public static void Register(IRaptorBlockModifier modifier)Adds modifier, replacing any modifier with the same Id.
| Parameter | Type | Description |
|---|---|---|
modifier | IRaptorBlockModifier | The modifier. |
Call from an [InitializeOnLoad] static constructor on the main thread. An exception in one callback is logged and does not stop the others.
Unregister
public static void Unregister(string id)Removes the modifier with id. Does nothing if there is none.
| Parameter | Type | Description |
|---|---|---|
id | string | The modifier's Id. |
Related types
- IRaptorBlockModifier: A feature that changes how a RaptorMesh Block builds without changing its editable mesh (the cage).