forked from hunterzonewu/unity-decompiled
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSyncListBool.cs
More file actions
56 lines (50 loc) · 1.87 KB
/
SyncListBool.cs
File metadata and controls
56 lines (50 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Decompiled with JetBrains decompiler
// Type: UnityEngine.Networking.SyncListBool
// Assembly: UnityEngine.Networking, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 8B34E19C-EF53-416E-AE36-35C45BAFD2DE
// Assembly location: C:\Users\Blake\sandbox\unity\test-project\Library\UnityAssemblies\UnityEngine.Networking.dll
using System;
namespace UnityEngine.Networking
{
/// <summary>
/// <para>A list of booleans that will be synchronized from server to clients.</para>
/// </summary>
public class SyncListBool : SyncList<bool>
{
protected override void SerializeItem(NetworkWriter writer, bool item)
{
writer.Write(item);
}
protected override bool DeserializeItem(NetworkReader reader)
{
return reader.ReadBoolean();
}
[Obsolete("ReadReference is now used instead")]
public static SyncListBool ReadInstance(NetworkReader reader)
{
ushort num = reader.ReadUInt16();
SyncListBool syncListBool = new SyncListBool();
for (ushort index = 0; (int) index < (int) num; ++index)
syncListBool.AddInternal(reader.ReadBoolean());
return syncListBool;
}
/// <summary>
/// <para>An internal function used for serializing SyncList member variables.</para>
/// </summary>
/// <param name="reader"></param>
/// <param name="syncList"></param>
public static void ReadReference(NetworkReader reader, SyncListBool syncList)
{
ushort num = reader.ReadUInt16();
syncList.Clear();
for (ushort index = 0; (int) index < (int) num; ++index)
syncList.AddInternal(reader.ReadBoolean());
}
public static void WriteInstance(NetworkWriter writer, SyncListBool items)
{
writer.Write((ushort) items.Count);
foreach (bool flag in (SyncList<bool>) items)
writer.Write(flag);
}
}
}