Skip to content

GenericFields

namespace Griff.Scenes;
public static class GenericFields

The editors the Inspector gives fields that have no editor of their own, by their type and what they hold, so a new component’s or script’s field never has to be typed as code: a list of strings is rows (ListRowsAttribute), or names and values (PairsAttribute) when every line reads “name: value” or “name = value”, their values numbers or colors when they all are. A list marked PlainTextAttribute keeps its lines as text.

public static RowsAttribute? For(PropertyDescriptor property, object? value)

The rows a list of strings with no editor of its own gets for value (what it holds now, or starts with); null for any other field.

public static bool IsColor(string? text)

True for a color written as hex with its “#”: “#F2607E”, “#FFF”, “#F2607E80”.