File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
MLAPI/NetworkingManagerComponents/Binary Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,8 @@ public object ReadObjectPacked(Type type)
127
127
return ReadRotation ( 3 ) ;
128
128
if ( type == typeof ( char ) )
129
129
return ReadCharPacked ( ) ;
130
+ if ( type . IsEnum )
131
+ return ReadInt32Packed ( ) ;
130
132
throw new ArgumentException ( "BitReader cannot read type " + type . Name ) ;
131
133
}
132
134
Original file line number Diff line number Diff line change @@ -145,6 +145,11 @@ public void WriteObjectPacked(object value)
145
145
WriteCharPacked ( ( char ) value ) ;
146
146
return ;
147
147
}
148
+ else if ( value . GetType ( ) . IsEnum )
149
+ {
150
+ WriteInt32Packed ( ( int ) value ) ;
151
+ return ;
152
+ }
148
153
149
154
throw new ArgumentException ( "BitWriter cannot write type " + value . GetType ( ) . Name ) ;
150
155
}
You can’t perform that action at this time.
0 commit comments