Infohazard.Core 1.4.1
Infohazard Core Utility Library
Loading...
Searching...
No Matches
Infohazard.Core.Editor.ObjectReferenceFieldAssignmentValidator Class Reference

IObjectReferenceFieldAssignmentValidator that uses Unity validation internally, and allows adding additional validation with a simplified interface. More...

Public Member Functions

 ObjectReferenceFieldAssignmentValidator (Func< Object, Object > validator=null)
 Construct with a given validation function. More...
 
virtual Object ValidateObjectFieldAssignment (Object[] references, Type objType, SerializedProperty property, int options)
 Validate the input objects for assignment to a field of the given type, and return a valid one.
Parameters
referencesAll objects attempting to be assigned.
objTypeThe type of the field.
propertyThe property that references the field.
optionsAdditional options (used internally by Unity).
Returns
The object to assign to the field, or null.
More...
 
Object ValidateObjectFieldAssignment (Object[] references, Type objType, SerializedProperty property, int options)
 Validate the input objects for assignment to a field of the given type, and return a valid one. More...
 

Detailed Description

IObjectReferenceFieldAssignmentValidator that uses Unity validation internally, and allows adding additional validation with a simplified interface.

Constructor & Destructor Documentation

◆ ObjectReferenceFieldAssignmentValidator()

Infohazard.Core.Editor.ObjectReferenceFieldAssignmentValidator.ObjectReferenceFieldAssignmentValidator ( Func< Object, Object >  validator = null)

Construct with a given validation function.

Parameters
validatorSimplified validation function that validates a single object.

Member Function Documentation

◆ ValidateObjectFieldAssignment()

virtual Object Infohazard.Core.Editor.ObjectReferenceFieldAssignmentValidator.ValidateObjectFieldAssignment ( Object[]  references,
Type  objType,
SerializedProperty  property,
int  options 
)
virtual

Validate the input objects for assignment to a field of the given type, and return a valid one.

Parameters
referencesAll objects attempting to be assigned.
objTypeThe type of the field.
propertyThe property that references the field.
optionsAdditional options (used internally by Unity).
Returns
The object to assign to the field, or null.

Implements Infohazard.Core.Editor.IObjectReferenceFieldAssignmentValidator.


The documentation for this class was generated from the following file: