private static void ErrorForNullRequiredWiresOnGameObject(GameObject gameObject, string pathToAsset) { List <NotNullViolation> errorsOnGameObject = NotNullChecker.FindErroringFields(gameObject); foreach (NotNullViolation violation in errorsOnGameObject) { Debug.LogError(violation + "\nPath: " + pathToAsset, violation.ErrorGameObject); } foreach (Transform child in gameObject.transform) { ErrorForNullRequiredWiresOnGameObject(child.gameObject, pathToAsset); } }
private static bool ErrorForNullRequiredWiresOnGameObject(GameObject gameObject, string pathToAsset) { var foundErrors = false; List <NotNullViolation> errorsOnGameObject = NotNullChecker.FindErroringFields(gameObject); foreach (NotNullViolation violation in errorsOnGameObject) { Debug.LogError(violation + "\nPath: " + pathToAsset, violation.ErrorGameObject); foundErrors = true; } foreach (Transform child in gameObject.transform) { foundErrors = foundErrors || ErrorForNullRequiredWiresOnGameObject(child.gameObject, pathToAsset); } return(foundErrors); }