public override bool Validate(Object obj) { var isValidated = true; var fields = GetFieldInfosApplyTo(obj); foreach (var field in fields) { var value = field.GetValue(obj); if (value == null) { DispatchVLogEvent(obj, VLogType.Error, string.Format("Field [{0}] on Object [{1}] is null when it should be a" + " reference to a project asset", field, obj.name)); isValidated = false; continue; } var unityObject = value as Object; if (ObjectUtility.IsNullReference(unityObject)) { DispatchVLogEvent(obj, VLogType.Warning, string.Format("Field [{0}] on Object [{1}] should not have a VIsProjectReference " + "attribute as it does not derive from UnityEngine.Object", field, obj.name)); continue; } if (!ObjectUtility.IsProjectReference(unityObject)) { DispatchVLogEvent(obj, VLogType.Error, string.Format("Field [{0}] on Object [{1}] does not refer to a project asset " + "when it should", field, obj.name)); isValidated = false; } } return(isValidated); }