fixing syncmode not showing up in Inspector (#1820)

syncMode and syncInterval now show up in Inspector when only sync vars are used
This commit is contained in:
James Frowen 2020-05-01 00:43:33 +01:00 committed by GitHub
parent 63e61bcbf4
commit fd929e2b6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,6 +21,12 @@ public class NetworkBehaviourInspector : Editor
// does this type sync anything? otherwise we don't need to show syncInterval
bool SyncsAnything(Type scriptClass)
{
// syncVarNames should be set because SyncsAnything is called
if (syncVarNames.Count > 0)
{
return true;
}
// has OnSerialize that is not in NetworkBehaviour?
// then it either has a syncvar or custom OnSerialize. either way
// this means we have something to sync.