diff --git a/Assets/Mirror/Core/NetworkBehaviour.cs b/Assets/Mirror/Core/NetworkBehaviour.cs index 45a3e0809..9240d7ffc 100644 --- a/Assets/Mirror/Core/NetworkBehaviour.cs +++ b/Assets/Mirror/Core/NetworkBehaviour.cs @@ -312,13 +312,13 @@ protected virtual void OnValidate() // GetComponentInParent(includeInactive) is needed because Prefabs are not // considered active, so this check requires to scan inactive. #if UNITY_EDITOR -#if UNITY_2021_3_OR_NEWER // 2021 has GetComponentInParents(active) +#if UNITY_2021_3_OR_NEWER // 2021 has GetComponentInParent(bool includeInactive = false) if (GetComponent() == null && GetComponentInParent(true) == null) { Debug.LogError($"{GetType()} on {name} requires a NetworkIdentity. Please add a NetworkIdentity component to {name} or it's parents.", this); } -#elif UNITY_2020_3_OR_NEWER // 2020 only has GetComponentsInParents(active), we can use this too +#elif UNITY_2020_3_OR_NEWER // 2020 only has GetComponentsInParent(bool includeInactive = false), we can use this too NetworkIdentity[] parentsIds = GetComponentsInParent(true); int parentIdsCount = parentsIds != null ? parentsIds.Length : 0; if (GetComponent() == null && parentIdsCount == 0)