vec4<C extends Component> static method
A Vector4 property.
Implementation
static ComponentField<C> vec4<C extends Component>(
String name, {
required Vector4 Function() defaultValue,
Vector4 Function(C component)? get,
void Function(C component, Vector4 value)? set,
String? doc,
String? group,
List<String> formerNames = const [],
bool transient = false,
}) => ComponentField(
ComponentPropertyDef(
name,
ComponentPropertyKind.vec4,
defaultValue: Vec4Value(defaultValue()),
doc: doc,
group: group,
formerNames: formerNames,
transient: transient,
),
read: get == null ? null : (c, _) => Vec4Value(get(c).clone()),
write: set == null
? null
: (c, v, _) {
if (v is Vec4Value) set(c, v.value.clone());
},
);