diff --git a/Assets/Mirror/Editor/SyncObjectCollectionsDrawer.cs b/Assets/Mirror/Editor/SyncObjectCollectionsDrawer.cs index 2c95bcf73..735b018da 100644 --- a/Assets/Mirror/Editor/SyncObjectCollectionsDrawer.cs +++ b/Assets/Mirror/Editor/SyncObjectCollectionsDrawer.cs @@ -4,6 +4,7 @@ using System.Collections; using System.Collections.Generic; using System.Reflection; +using System.Text.RegularExpressions; using UnityEditor; namespace Mirror @@ -18,7 +19,12 @@ public SyncObjectCollectionField(FieldInfo field) { this.field = field; visible = false; - label = $"{field.Name} [{field.FieldType.Name}]"; + + // field.FieldType.Name has a backtick and number at the end, e.g. SyncList`1 + // so we split it and only take the first part so it looks nicer. + // e.g. SyncList`1 -> SyncList + // Better to do it one time here than in hot path in OnInspectorGUI + label = $"{field.Name} [{Regex.Replace(field.FieldType.Name, @"`\d+", "")}]"; } }