ChoiceOfAttribute
namespace Griff.Scenes;
public sealed class ChoiceOfAttribute : FieldEditorAttributeMarks 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.
Properties
Section titled “Properties”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.
Member
Section titled “Member”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)”.
Methods
Section titled “Methods”Choices
Section titled “Choices”public IReadOnlyList<string> Choices(Component component)What component lists to pick from now.
Describe
Section titled “Describe”public override string Describe()Problem
Section titled “Problem”public override string? Problem(Component component, object? value)