static IEnumerable <Error> checkUnityEvent( IErrorFactory errorFactory, FieldHierarchyStr fieldHierarchy, UnityEventBase evt ) { UnityEventReflector.rebuildPersistentCallsIfNeeded(evt); var persistentCalls = evt.__persistentCalls(); var listPersistentCallOpt = persistentCalls.calls; foreach (var listPersistentCall in listPersistentCallOpt) { var index = 0; foreach (var persistentCall in listPersistentCall) { if (persistentCall.isValid) { if (evt.__findMethod(persistentCall).isNone) { yield return(errorFactory.unityEventInvalidMethod(fieldHierarchy, index)); } } else { yield return(errorFactory.unityEventInvalid(fieldHierarchy, index)); } index++; } } }
public static Error customValidationException( Object o, FieldHierarchyStr hierarchy, Exception exception, CheckContext context ) => new Error( Type.CustomValidationException, $"{context}. Property: {hierarchy.s}. Error while running {nameof(OnObjectValidate)}:\n{exception}", o );
public static Error emptyCollection( Object o, FieldHierarchyStr hierarchy, CheckContext context ) => new Error( Type.EmptyCollection, $"{context}. Property: {hierarchy.s}", o );
public static Error customError( Object o, FieldHierarchyStr hierarchy, ErrorMsg error, CheckContext context, bool useErrorMessageContext ) => new Error( Type.CustomValidation, $"{context}. Property: {hierarchy.s}. Error: {error}", useErrorMessageContext ? error.context.getOrElse(o) : o );
public static Error badTextFieldTag( Object o, FieldHierarchyStr hierarchy, CheckContext context ) => new Error( Type.TextFieldBadTag, $"{context}. Property: {hierarchy.s}", o );
public static Error nullReference( Object o, FieldHierarchyStr hierarchy, CheckContext context ) => new Error( Type.NullReference, $"{context}. Property: {hierarchy.s}", o );
public static Error customError( Object o, FieldHierarchyStr hierarchy, ErrorMsg error, CheckContext context ) => new Error( Type.CustomValidation, $"{context}. Property: {hierarchy.s}. Error: {error}", o );
public static Error unityEventInvalid( Object o, FieldHierarchyStr hierarchy, int index, CheckContext context ) => new Error( Type.UnityEventInvalid, $"{unityEventMessagePrefix(hierarchy.s, index)} is not valid " + unityEventMessageSuffix(context), o );
public Error custom(FieldHierarchyStr hierarchy, ErrorMsg customErrorMessage, bool useErrorMessageContext) => Error.customError(o: component, hierarchy: hierarchy, error: customErrorMessage, context: context, useErrorMessageContext);
public Error exceptionInCustomValidator(FieldHierarchyStr hierarchy, Exception exception) => Error.customValidationException(o: component, hierarchy: hierarchy, exception: exception, context: context);
public Error unityEventInvalidMethod(FieldHierarchyStr hierarchy, int index) => Error.unityEventInvalidMethod(o: component, hierarchy: hierarchy, index: index, context: context);
public Error badTextFieldTag(FieldHierarchyStr hierarchy) => Error.badTextFieldTag(o: component, hierarchy: hierarchy, context: context);
public Error emptyString(FieldHierarchyStr hierarchy) => Error.emptyString(o: component, hierarchy: hierarchy, context: context);
public Error emptyCollection(FieldHierarchyStr hierarchy) => Error.emptyCollection(o: component, hierarchy: hierarchy, context: context);
public Error nullField(FieldHierarchyStr hierarchy) => Error.nullReference(o: component, hierarchy: hierarchy, context: context);