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)
133133 ( ( IBitWritable ) instance ) . Read ( this ) ;
134134 return instance ;
135135 }
136+ if ( type . IsEnum )
137+ return ReadInt32Packed ( ) ;
138+
136139 throw new ArgumentException ( "BitReader cannot read type " + type . Name ) ;
137140 }
138141
Original file line number Diff line number Diff line change @@ -150,6 +150,11 @@ public void WriteObjectPacked(object value)
150150 ( ( IBitWritable ) value ) . Write ( this ) ;
151151 return ;
152152 }
153+ else if ( value . GetType ( ) . IsEnum )
154+ {
155+ WriteInt32Packed ( ( int ) value ) ;
156+ return ;
157+ }
153158
154159 throw new ArgumentException ( "BitWriter cannot write type " + value . GetType ( ) . Name ) ;
155160 }
You can’t perform that action at this time.
0 commit comments