FindErroringFields() 공개 정적인 메소드

Finds the erroring NotNull fields on a GameObject.
public static FindErroringFields ( GameObject sourceObject ) : List
sourceObject UnityEngine.GameObject Source object.
리턴 List
예제 #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);
        }