File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
MLAPI/NetworkingManagerComponents Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 4
4
using System . Linq ;
5
5
using System . Reflection ;
6
6
using System . Text ;
7
+ using UnityEngine ;
7
8
8
9
namespace MLAPI . NetworkingManagerComponents
9
10
{
@@ -74,6 +75,8 @@ public static byte[] Serialize<T>(T instance)
74
75
outputSize += Encoding . UTF8 . GetByteCount ( ( string ) sortedFields [ i ] . GetValue ( instance ) ) + 2 ;
75
76
else if ( sortedFields [ i ] . FieldType == typeof ( byte [ ] ) )
76
77
outputSize += ( ( byte [ ] ) sortedFields [ i ] . GetValue ( instance ) ) . Length + 2 ; //Two bytes to specify the size
78
+ else
79
+ Debug . LogWarning ( "MLAPI: The type \" " + sortedFields [ i ] . FieldType . Name + "\" is not supported by the Binary Serializer. It will be ignored" ) ;
77
80
}
78
81
79
82
//Write data
@@ -187,6 +190,8 @@ public static byte[] Serialize<T>(T instance)
187
190
ushort size = reader . ReadUInt16 ( ) ;
188
191
sortedFields [ i ] . SetValue ( instance , reader . ReadBytes ( size ) ) ;
189
192
}
193
+ else
194
+ Debug . LogWarning ( "MLAPI: The type \" " + sortedFields [ i ] . FieldType . Name + "\" is not supported by the Binary Serializer. It will be ignored" ) ;
190
195
}
191
196
}
192
197
}
You can’t perform that action at this time.
0 commit comments