Get RAPTOR

RaptorBlockModifiers

The registry of IRaptorBlockModifiers.

NamespaceAssemblyKindStability
Raptor.EditorToolsRaptor.Editorclasspreview, 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 RaptorBlockModifiers

Properties

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.

ParameterTypeDescription
modifierIRaptorBlockModifierThe 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.

ParameterTypeDescription
idstringThe modifier's Id.
  • IRaptorBlockModifier: A feature that changes how a RaptorMesh Block builds without changing its editable mesh (the cage).