Skip to content

EntityNameAttribute

namespace Griff.Scenes;
public sealed class EntityNameAttribute : Attribute

Marks a string property as naming an entity, e.g. what a camera follows or what a switch turns on: the editor’s Inspector lets you pick one from a list of the scene’s entities or drop one on it from the Hierarchy.

public bool Any { get; init; }

“*” is allowed and means any entity in the scene, the first that has what the field reads (a counter’s Track, for a HUD’s counter of a board’s score): it names none, so none is drawn as a link or flagged.

public bool Every { get; init; }

It means every entity with the name (a level’s Targets, to knock out), so several answering to it are not ambiguous.

public bool Incoming { get; init; }

It names where something comes from (a wire’s From, a trigger’s From) rather than what this entity acts on: the Scene view’s arrow points from the entity it names to this one.

public bool Inside { get; init; }

It names one inside the entity (an attack’s Hitbox, a panel’s First control), so those are the ones listed.

public bool Many { get; init; }

It names several, separated by commas (a switch’s Targets): picking one adds it, or takes it out again.

public string? Unless { get; init; }

A property that, when set (not empty, false or zero), means this one isn’t used, e.g. a door’s Target when it goes to another Scene. Its names then aren’t drawn as links or flagged when they match nothing.