Get RAPTOR

RaptorSuitePropertyEdits.ProjectMarkers

Project component types whose objects are edited by a project tool.

NamespaceAssemblyKindStability
Raptor.EditorToolsRaptor.Editorclasspreview, since 0.1.0

The project registers each type with the owner word shown in the Properties lock message (for example "Prop" in "Prop properties use their dedicated authoring tools"). The lock check runs after the core markers, on each parent, in the order of the object's components. Types match exactly, so a subclass must be registered separately. With entityBodyOwns, an entity's Body block owns the component and no separate section is shown for it.

Each type can be registered once; a repeat returns false. Each change clears the cached owners. Registrations are editor-only and cleared on domain reload, after which registrants run again.

public static class ProjectMarkers

Properties

Count

public static int Count { get; }

Gets the number of markers.

Version

public static int Version { get; }

Gets a counter that increases by one on every change.

Methods

EntityBodyOwns

public static bool EntityBodyOwns(Type marker)

Whether an entity's Body block owns components of this registered type.

ParameterTypeDescription
markerTypeThe component type.

Returns: True when it does.

IsRegistered

public static bool IsRegistered(Type marker)

Whether this type is registered.

ParameterTypeDescription
markerTypeThe component type.

Returns: True when registered.

OwnerOf

public static string OwnerOf(Type marker)

Returns the owner word of a registered type, or null.

ParameterTypeDescription
markerTypeThe component type.

Returns: The word, or null.

Register

public static bool Register(Type marker, string owner, bool entityBodyOwns = false)

Adds a marker. Returns false and keeps the existing entry when marker is already registered. Throws for a null type, a type that is not a Component, or a blank owner word.

ParameterTypeDefaultDescription
markerTypeThe component type.
ownerstringThe owner word shown in the lock message.
entityBodyOwnsboolfalseWhether an entity's Body block owns this component.

Returns: False when the type is already registered.

Call from an [InitializeOnLoad] static constructor on the main thread.