Get RAPTOR

IRaptorBlockModifier

A feature that changes how a RaptorMesh Block builds without changing its editable mesh (the cage).

NamespaceAssemblyKindStability
Raptor.EditorToolsRaptor.Editorinterfacepreview, since 0.1.0

RAPTOR discovers every non-abstract implementation that has a public parameterless constructor (RaptorBlockModifiers.All). No registration is needed. Hash markers below 2000 are reserved for RAPTOR. A third-party modifier must mix a hash of its Id first.

public interface IRaptorBlockModifier

Properties

DisplayPriority

int DisplayPriority { get; }

Of the modifiers whose DisplayActive returns true, the one with the highest priority builds the Block's display copy. Ties go to the modifier that comes first in Order.

Id

string Id { get; }

A persistent id, for example "studio.rounded-corners". Must be unique.

Order

int Order { get; }

The order for hashing and Inspector lines. Lower values come first; ties are sorted by Id (ordinal).

Methods

Display

RaptorBlockDisplay Display(RaptorMesh km, PolygonMesh cage, int version)

Returns the render-only copy of cage, or null to pack the cage unchanged. The cage is packed beside the copy as collision only. version is the live mesh's edit version (0 for a packed mesh). Use it as a cache key.

ParameterTypeDescription
kmRaptorMeshThe Block.
cagePolygonMeshThe Block's editable mesh.
versionintThe live mesh's version, or 0 for packed data.

Returns: The copy, or null.

DisplayActive

bool DisplayActive(RaptorMesh km)

Returns whether this modifier builds km's display copy.

ParameterTypeDescription
kmRaptorMeshThe Block.

Returns: True to build the display copy.

InspectorLine

string InspectorLine(IReadOnlyList<RaptorMesh> meshes)

Returns the Unity Inspector line for these Blocks, or null for none.

ParameterTypeDescription
meshesIReadOnlyList<RaptorMesh>The Blocks.

Returns: The line, or null.

MixBakeHash

void MixBakeHash(RaptorMesh km, Action<long> mix)

Mixes this modifier's words into the persisted bake hash. Mix nothing when the modifier does not change the Block, so its hash is unaffected.

ParameterTypeDescription
kmRaptorMeshThe Block.
mixAction<long>Mixes one word into the hash.

MixSessionHash

void MixSessionHash(RaptorMesh km, Action<ulong> mix)

Mixes this modifier's words into the session hash, which the editor uses to detect rebuilds and does not save. As with MixBakeHash, mix nothing when the modifier does not change the Block.

ParameterTypeDescription
kmRaptorMeshThe Block.
mixAction<ulong>Mixes one word into the hash.