fix(NetworkIdentity): Improved DisallowChildNetworkIdentities Error Logging

References the offending object so it gets highlighted in the Editor when the error is clicked.
This commit is contained in:
MrGadget1024 2024-01-09 19:43:48 -05:00
parent 28b1e8b374
commit 8543f1f37d

View File

@ -375,7 +375,7 @@ void DisallowChildNetworkIdentities()
{ {
// always log the next child component so it's easy to fix. // always log the next child component so it's easy to fix.
// if there are multiple, then after removing it'll log the next. // if there are multiple, then after removing it'll log the next.
Debug.LogError($"'{name}' has another NetworkIdentity component on '{identities[1].name}'. There should only be one NetworkIdentity, and it must be on the root object. Please remove the other one."); Debug.LogError($"'{name}' has another NetworkIdentity component on '{identities[1].name}'. There should only be one NetworkIdentity, and it must be on the root object. Please remove the other one.", this);
} }
} }