Skip to main content

ValidatePrefabApplyAttribute

A class in Alta.Attributes, the global namespace.

Prefab-apply attribute for a bool field: when a prefab is applied, sets the field to the result of a named method on the component.

Constructors​

MemberWhat it is
ValidatePrefabApplyAttribute(string method)Creates a ValidatePrefabApplyAttribute from method.

Fields​

2 private and internal fields
MemberWhat it is
private static readonly BindingFlags flagsBinding flags for finding the method: instance or static, public or not.
private string methodName of the bool method to call.

Methods​

MemberWhat it is
override bool HandleApply(Component component, FieldInfo field, GameObject prefab)Calls the named method (searching base types) and writes its bool to the field. Returns true if the value changed.