Skip to content

Commit 5f0ea3d

Browse files
committed
fix the InstanceKey
1 parent 1b97473 commit 5f0ea3d

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

CSync/Lib/ConfigManager.cs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,20 @@ public static void Register<T>(T config) where T : SyncedConfig<T> {
9797

9898
[UsedImplicitly]
9999
[Serializable]
100-
[SuppressMessage("ReSharper", "Unity.RedundantSerializeFieldAttribute")] // they are *not* redundant!
101-
public readonly record struct InstanceKey(string Guid, string AssemblyQualifiedName)
100+
public record struct InstanceKey
102101
{
103-
[field: SerializeField]
104-
public string Guid { get; }
102+
public InstanceKey(string guid, string assemblyQualifiedName)
103+
{
104+
_guid = guid;
105+
_assemblyQualifiedName = assemblyQualifiedName;
106+
}
107+
108+
[SerializeField]
109+
private string _guid;
110+
[SerializeField]
111+
private string _assemblyQualifiedName;
105112

106-
[field: SerializeField]
107-
public string AssemblyQualifiedName { get; }
113+
public string Guid => _guid;
114+
public string AssemblyQualifiedName => _assemblyQualifiedName;
108115
}
109116
}

0 commit comments

Comments
 (0)