From fd929e2b6d23f88d4d58178decefc1d4d4c2d239 Mon Sep 17 00:00:00 2001 From: James Frowen Date: Fri, 1 May 2020 00:43:33 +0100 Subject: [PATCH] fixing syncmode not showing up in Inspector (#1820) syncMode and syncInterval now show up in Inspector when only sync vars are used --- Assets/Mirror/Editor/NetworkBehaviourInspector.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Assets/Mirror/Editor/NetworkBehaviourInspector.cs b/Assets/Mirror/Editor/NetworkBehaviourInspector.cs index 228dfdb4d..561b0e2cc 100644 --- a/Assets/Mirror/Editor/NetworkBehaviourInspector.cs +++ b/Assets/Mirror/Editor/NetworkBehaviourInspector.cs @@ -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.