add comments

This commit is contained in:
vis2k 2022-12-09 20:47:50 +01:00
parent c994bb41b7
commit 8f480ad963
2 changed files with 12 additions and 0 deletions

View File

@ -236,6 +236,9 @@ public static GameObject ReadGameObject(this NetworkReader reader)
return networkIdentity != null ? networkIdentity.gameObject : null;
}
// while SyncList<T> is recommended for NetworkBehaviours,
// structs may have .List<T> members which weaver needs to be able to
// fully serialize for NetworkMessages etc.
public static List<T> ReadList<T>(this NetworkReader reader)
{
int length = reader.ReadInt();
@ -249,6 +252,9 @@ public static List<T> ReadList<T>(this NetworkReader reader)
return result;
}
// while SyncSet<T> is recommended for NetworkBehaviours,
// structs may have .Set<T> members which weaver needs to be able to
// fully serialize for NetworkMessages etc.
public static HashSet<T> ReadHashSet<T>(this NetworkReader reader)
{
int length = reader.ReadInt();

View File

@ -269,6 +269,9 @@ public static void WriteGameObject(this NetworkWriter writer, GameObject value)
writer.WriteNetworkIdentity(identity);
}
// while SyncList<T> is recommended for NetworkBehaviours,
// structs may have .List<T> members which weaver needs to be able to
// fully serialize for NetworkMessages etc.
public static void WriteList<T>(this NetworkWriter writer, List<T> list)
{
if (list is null)
@ -281,6 +284,9 @@ public static void WriteList<T>(this NetworkWriter writer, List<T> list)
writer.Write(list[i]);
}
// while SyncSet<T> is recommended for NetworkBehaviours,
// structs may have .Set<T> members which weaver needs to be able to
// fully serialize for NetworkMessages etc.
public static void WriteHashSet<T>(this NetworkWriter writer, HashSet<T> hashSet)
{
if (hashSet is null)