We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 01415d9 + ed70bbb commit 54ffa00Copy full SHA for 54ffa00
2 files changed
MLAPI/NetworkingManagerComponents/Binary/BitReader.cs
@@ -133,6 +133,9 @@ public object ReadObjectPacked(Type type)
133
((IBitWritable)instance).Read(this);
134
return instance;
135
}
136
+ if (type.IsEnum)
137
+ return ReadInt32Packed();
138
+
139
throw new ArgumentException("BitReader cannot read type " + type.Name);
140
141
MLAPI/NetworkingManagerComponents/Binary/BitWriter.cs
@@ -150,6 +150,11 @@ public void WriteObjectPacked(object value)
150
((IBitWritable)value).Write(this);
151
return;
152
153
+ else if (value.GetType().IsEnum)
154
+ {
155
+ WriteInt32Packed((int)value);
156
+ return;
157
+ }
158
159
throw new ArgumentException("BitWriter cannot write type " + value.GetType().Name);
160
0 commit comments