Skip to content

ChoiceOfAttribute

namespace Griff.Scenes;
public sealed class ChoiceOfAttribute : FieldEditorAttribute

Marks a string property as naming one of what another member of its component lists, e.g. an animation’s Clip one of its clips: the Inspector picks from them, and flags a name that isn’t one.

public string? Also { get; init; }

A member of the component listing names that are right too but aren’t offered (the former names of what it lists, see FormerNameAttribute), so a scene saved before a rename isn’t flagged.

public string Member { get; }

The member of the component that lists the choices.

public string? Noun { get; init; }

What the choices are, for component_describe, e.g. “one of its clips (Clips)”.

public IReadOnlyList<string> Choices(Component component)

What component lists to pick from now.

public override string Describe()
public override string? Problem(Component component, object? value)