InteractionContextDrawer

Odin value drawer for InteractionContext. Renders each context as a foldable panel whose header displays the interaction type name, with triggers, conditions, and the interaction drawn as indented child properties.

Definition

Namespace: Paragon.Townskeep.InteractionSystem.Editor Assembly: Townskeep.Editor.dll

[DrawerPriority(0.0, 0.0, 3000.0), UsedImplicitly]
public class InteractionContextDrawer : OdinValueDrawer<InteractionContext>

Inheritance: OdinValueDrawer<InteractionContext>InteractionContextDrawer

Remarks

This drawer provides the visual representation for individual InteractionContext entries within an InteractionTable. It gives designers a clear, organized view of each interaction's complete configuration.

Layout Structure

┌─────────────────────────────────────────┐
│ ▼ [Interaction Type Name]               │  ← Foldout header (nicified type name)
├─────────────────────────────────────────┤
│ ─────────────────────────────────────── │  ← Horizontal line separator
│     ┌──────────────────────────────┐    │
│     │ Triggers                     │    │  ← triggers list (Odin list drawer)
│     │ ┌──────────────────────────┐ │    │
│     │ │ [Trigger entries...]     │ │    │
│     │ └──────────────────────────┘ │    │
│     │                              │    │
│     │ Conditions                   │    │  ← conditions list (uses InteractionConditionDrawer)
│     │ ┌──────────────────────────┐ │    │
│     │ │ [Condition entries...]   │ │    │
│     │ └──────────────────────────┘ │    │
│     │                              │    │
│     │ Interaction                  │    │  ← interaction field (polymorphic)
│     │ ┌──────────────────────────┐ │    │
│     │ │ [Interaction fields...]  │ │    │
│     │ └──────────────────────────┘ │    │
│     └──────────────────────────────┘    │
└─────────────────────────────────────────┘

Header Label

The header displays the nicified type name of the contained interaction (e.g., SitInteraction → "Sit Interaction"). If the interaction is null, the header displays "Empty Context".

Child Property Drawing

The drawer explicitly draws the three child properties in order:

  1. triggers — the list of InteractionTrigger instances

  2. conditions — the list of InteractionCondition instances (each rendered by InteractionConditionDrawer)

  3. interaction — the polymorphic Interaction field

Margin adjustments (SirenixGUIStyles.PropertyMargin) are applied to ensure the triggers and conditions lists render flush, while the interaction field has standard padding.

Quick Lookup

Goal
How

See which interaction this context runs

Read the foldout header label

Add/remove triggers

Expand the context, use the triggers list controls

Add/remove conditions

Expand the context, use the conditions list controls

Change the interaction type

Modify the interaction field (polymorphic selector)

Methods

Initialize (override)

Caches the InteractionContext value for header label rendering.

DrawPropertyLayout (override)

Draws the context panel — foldout header with interaction type name, horizontal separator, then indented triggers/conditions/interaction.

Parameter
Type
Description

label

GUIContent

The label for this property (typically unused — header derives from interaction type)

Common Pitfalls

circle-exclamation
circle-exclamation

See Also

Last updated