Skip to content
Project referenceDevelopmentEngine ccf7d03f
Authored
  • Stateless Inspector presentation metadata with an explicit authoring-only script surface.

This project defines Inspector authoring annotations. It uses System.Attribute and assembly/export identity contracts, without depending on Serialization, Scene, Rendering, ImGui or a panel. Inspection interprets the metadata; Serialization remains responsible for data.

All presentation attributes derive from InspectorPresentationAttribute and share writable display ordering.

Annotation Reader-visible effect
Header A group title with an optional hover description.
Text Persistent neutral explanation.
Space Logical-pixel spacing.
Tooltip Row hover help without permanent layout space.
InspectorName Display naming without changing a persistent property key.
Range Numeric editing limits, not runtime value validation.
InspectorReadOnly Disabled editing.
ShowIf / HideIf Visibility based on an identified member and condition.
HelpBox An informational, warning or error card with optional conditions.

Conditions include truthiness, equality, nullness and assignment. Read each overload for its exact accepted values. Invalid titles/member names, ranges and spacing are rejected as specified; invalid metadata conditions produce Inspector diagnostics.

This example belongs to an authoring script compilation with the actual runtime and Editor annotation facades:

using InnoEngine.Scene;
using InnoEngine.Serialization;
using InnoEditor.Annotations;
public sealed class Mover : GameBehavior
{
[SerializableProperty]
[Header("Movement", "World units per second.")]
[Tooltip("Maximum movement speed.")]
[Range(0, 30)]
public float speed { get; set; } = 6;
}

The annotation does not make a property serializable. SerializableProperty remains explicit. Runtime validation also remains a domain responsibility; an Inspector slider cannot enforce values written by other code.

The assembly uses AssemblyScope.Runtime, allowing authoring game modules to retain pure metadata. Its export scope is ScriptingApiScope.Authoring. These describe different boundaries: loading dependencies versus publication semantics.

Host Editor code uses Inno.Editor.Annotations; authoring scripts use InnoEditor.Annotations. Player compilation erases authoring annotations, custom derived annotation declarations and their related imports before binding platform assemblies. The final Player does not retain this assembly reference. This does not grant game scripts access to Editor hosts, panels or drawing services.

Derive from InspectorPresentationAttribute to introduce metadata and provide the corresponding InspectorAttributeDrawer through the Inspection extension system. Store only scalar values, strings and enums. An attribute has no protected lifecycle hook and must not own services or live resources.

Drawers rebuild with the TypeCache generation. Static retention of collectible types would prevent retirement. The source reference describes the CLR contracts; correct authoring erasure and script export remain separate validation obligations.

Exact constructors, condition enums and inherited contracts come from the bound source facts. Presentation metadata has no initialization or disposal sequence of its own.

Browse annotation types.

The compiler-selected script declarations are separate from this project’s host CLR surface. Read the script calling guide and the associated module contracts before using a projected member.

Project: Inno.Editor.Annotations
Source: src/composition/editor/contracts/Inno.Editor.Annotations/Inno.Editor.Annotations.csproj

Type API Description
HeaderAttribute engine Starts a visually separated Inspector section before the annotated property.
HelpBoxAttribute engine Draws a wrapped explanatory message before the annotated Inspector property.
HideIfAttribute engine Hides the annotated Inspector property when a sibling member satisfies a condition.
InspectorCondition engine Defines the comparison used by conditional Inspector presentation.
InspectorMessageType engine Selects the visual severity of an Inspector help message.
InspectorNameAttribute engine Replaces the generated Inspector label for one property.
InspectorPresentationAttribute engine Provides editor-only presentation metadata for one serialized field or property.
InspectorReadOnlyAttribute engine Makes an otherwise writable serialized property read-only in the Inspector.
RangeAttribute engine Constrains a numeric Inspector control to an inclusive range.
ShowIfAttribute engine Shows the annotated Inspector property only when a sibling member satisfies a condition.
SpaceAttribute engine Inserts vertical spacing before the annotated Inspector property.
TextAttribute engine Draws persistent wrapped explanatory text before the annotated Inspector property.
TooltipAttribute engine Provides hover help for one Inspector property label.
HeaderAttribute Authoring Starts a visually separated Inspector section before the annotated property.
HelpBoxAttribute Authoring Draws a wrapped explanatory message before the annotated Inspector property.
HideIfAttribute Authoring Hides the annotated Inspector property when a sibling member satisfies a condition.
InspectorCondition Authoring Defines the comparison used by conditional Inspector presentation.
InspectorMessageType Authoring Selects the visual severity of an Inspector help message.
InspectorNameAttribute Authoring Replaces the generated Inspector label for one property.
InspectorPresentationAttribute Authoring Provides editor-only presentation metadata for one serialized field or property.
InspectorReadOnlyAttribute Authoring Makes an otherwise writable serialized property read-only in the Inspector.
RangeAttribute Authoring Constrains a numeric Inspector control to an inclusive range.
ShowIfAttribute Authoring Shows the annotated Inspector property only when a sibling member satisfies a condition.
SpaceAttribute Authoring Inserts vertical spacing before the annotated Inspector property.
TextAttribute Authoring Draws persistent wrapped explanatory text before the annotated Inspector property.
TooltipAttribute Authoring Provides hover help for one Inspector property label.