Skip to content

Component

namespace Griff.Scenes;
public abstract class Component

A piece of data or behavior attached to an Entity. Public properties with a getter and setter are saved in scene files and shown in the editor’s inspector; mark a property DoNotSerializeAttribute to exclude it.

public Entity? Entity { get; }

The entity this component is attached to, or null while detached.

public IReadOnlyList<KeyValuePair<string, JsonElement>>? Kept { get; }

Saved values it has no property for (one since removed, or written by a newer Griff), kept as they were read and written back on save.

public virtual string? LinkLabel(string property)

What the Scene view’s arrow for one of its fields naming entities (property) says, e.g. a trigger’s “Score: Damage 2”; null for the component’s and field’s names (“Switch Targets”).

public virtual string? SetupNote()

A line on how it’s set up, shown in the Inspector above its fields (a tilemap layer names its map); null for none.

public virtual bool Uses(string property)

False for a property this component doesn’t use as it’s set up now (a tilemap layer’s tileset settings, which come from its map), so the Inspector hides it. True by default.