Skip to content

Commit 5ab9420

Browse files
larusEmandM
andauthored
Apply suggestions from code review
Co-authored-by: Emma <[email protected]>
1 parent 9304106 commit 5ab9420

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

com.unity.netcode.gameobjects/Documentation~/basics/networkvariable.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ The recommended workaround for this would be to create the generic class as usua
631631
For example:
632632

633633
```csharp
634-
public class FirstGenClass<T> : INetworkSerializable
634+
public class MyGameData<T> : INetworkSerializable
635635
{
636636
// This needs to be a serializable type according to what network variables support
637637
public T Data;
@@ -646,16 +646,16 @@ public class FirstGenClass<T> : INetworkSerializable
646646
}
647647
}
648648

649-
public class SecondGenWithLong : FirstGenClass<long>, IEquatable<SecondGenWithLong>
649+
public class GameDataWithLong : MyGameData<long>, IEquatable<GameDataWithLong>
650650
{
651651
// Potential additional data
652652
public int AdditionalData;
653653

654-
protected virtual bool OnEquals(SecondGenWithLong other)
654+
protected virtual bool OnEquals(GameDataWithLong other)
655655
{
656656
return other.Data.Equals(other);
657657
}
658-
public bool Equals(SecondGenWithLong other)
658+
public bool Equals(GameDataWithLong other)
659659
{
660660
return OnEquals(other);
661661
}
@@ -671,5 +671,5 @@ public class SecondGenWithLong : FirstGenClass<long>, IEquatable<SecondGenWithLo
671671
Then declare this network variable like so:
672672

673673
```csharp
674-
NetworkVariable<SecondGenWithLong> myVar = new NetworkVariable<SecondGenWithLong>();
674+
NetworkVariable<GameDataWithLong> myVar = new NetworkVariable<GameDataWithLong>();
675675
```

0 commit comments

Comments
 (0)