File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
MLAPI/NetworkingManagerComponents/Binary Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,9 @@ public object ReadObjectPacked(Type type)
133
133
( ( IBitWritable ) instance ) . Read ( this ) ;
134
134
return instance ;
135
135
}
136
+ if ( type . IsEnum )
137
+ return ReadInt32Packed ( ) ;
138
+
136
139
throw new ArgumentException ( "BitReader cannot read type " + type . Name ) ;
137
140
}
138
141
Original file line number Diff line number Diff line change @@ -150,6 +150,11 @@ public void WriteObjectPacked(object value)
150
150
( ( IBitWritable ) value ) . Write ( this ) ;
151
151
return ;
152
152
}
153
+ else if ( value . GetType ( ) . IsEnum )
154
+ {
155
+ WriteInt32Packed ( ( int ) value ) ;
156
+ return ;
157
+ }
153
158
154
159
throw new ArgumentException ( "BitWriter cannot write type " + value . GetType ( ) . Name ) ;
155
160
}
You can’t perform that action at this time.
0 commit comments