Skip to content

ShownWhenAttribute

namespace Griff.Scenes;
public sealed class ShownWhenAttribute : Attribute

Says a property is only used while another is on, e.g. [ShownWhen(nameof(Dash))] on a dash’s speed: the editor’s Inspector fades it while the other is off (false, zero or empty), and it can still be set ahead of time.

public object[]? Is { get; init; }

For an enum: the values the other has to be one of, rather than any but its first.

public string Property { get; }

The property it depends on, in the same component.