This class is responsible for checking objects for NotNull violations.
コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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);
        }