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)
127127 return ReadRotation ( 3 ) ;
128128 if ( type == typeof ( char ) )
129129 return ReadCharPacked ( ) ;
130+ if ( type . IsEnum )
131+ return ReadInt32Packed ( ) ;
130132 throw new ArgumentException ( "BitReader cannot read type " + type . Name ) ;
131133 }
132134
Original file line number Diff line number Diff line change @@ -145,6 +145,11 @@ public void WriteObjectPacked(object value)
145145 WriteCharPacked ( ( char ) value ) ;
146146 return ;
147147 }
148+ else if ( value . GetType ( ) . IsEnum )
149+ {
150+ WriteInt32Packed ( ( int ) value ) ;
151+ return ;
152+ }
148153
149154 throw new ArgumentException ( "BitWriter cannot write type " + value . GetType ( ) . Name ) ;
150155 }
You can’t perform that action at this time.
0 commit comments