Skip to content

ComponentFocus

namespace Griff.Scenes;
public static class ComponentFocus

The properties of component types that say whether they take the player’s input (see FocusAttribute), found the first time each type is asked about and kept for as long as it’s loaded. Reading and setting them allocates nothing.

public static bool Has(Type type)

True if components of type can have focus: they have a property marked FocusAttribute.

public static IReadOnlyList<PropertyInfo> PropertiesOf(Type type)

The properties of type (its base types’ too) marked FocusAttribute.

public static bool Takes(Component component)

True if component takes the player’s input: every property of it marked FocusAttribute is on (or it has none).