Skip to content

Commit a544560

Browse files
larusjabbacakes
andauthored
Apply suggestion from @jabbacakes
Co-authored-by: Amy Reeve <amy.reeve@unity3d.com>
1 parent 0934f7c commit a544560

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

com.unity.netcode.gameobjects/Documentation~/advanced-topics/serialization/inetworkserializable.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ public struct MyStructB : MyStructA
184184

185185
## Generic IEquatable network variables
186186

187-
Generic `INetworkSerializable` types with generic `IEquatable` are not supported, implemented as `public class NotSupported<T> : INetworkSerializable, IEquatable<NotSupported<T>>` where the type would be passed in during declaration like `NetworkVariable<NotSupported<int>> myVar;`.
187+
Netcode for GameObjects doesn't support generic `INetworkSerializable` types with generic `IEquatable`s when implemented as `public class NotSupported<T> : INetworkSerializable, IEquatable<NotSupported<T>>`, where the type is passed in during declaration like `NetworkVariable<NotSupported<int>> myVar;`.
188188

189189
The recommended workaround for this would be to create the generic class as usual but add a virtual method for handling the serialization of the type. Then wrap this generic `INetworkSerializable` in a derived class which then needs to have a serializable type defined where the implementation for the serialization is provided.
190190

0 commit comments

Comments
 (0)