Fix reading Variant Type in C#
This commit is contained in:
@@ -354,6 +354,8 @@ namespace FlaxEngine.Utilities
|
||||
if (typeNameLength == int.MaxValue)
|
||||
{
|
||||
typeNameLength = stream.ReadInt32();
|
||||
if (typeNameLength > 0)
|
||||
{
|
||||
var data = new byte[typeNameLength];
|
||||
for (int i = 0; i < typeNameLength; i++)
|
||||
{
|
||||
@@ -363,6 +365,7 @@ namespace FlaxEngine.Utilities
|
||||
var typeName = System.Text.Encoding.ASCII.GetString(data);
|
||||
return TypeUtils.GetType(typeName);
|
||||
}
|
||||
}
|
||||
if (typeNameLength > 0)
|
||||
{
|
||||
// [Deprecated on 27.08.2020, expires on 27.08.2021]
|
||||
@@ -426,6 +429,8 @@ namespace FlaxEngine.Utilities
|
||||
if (typeNameLength == int.MaxValue)
|
||||
{
|
||||
typeNameLength = stream.ReadInt32();
|
||||
if (typeNameLength > 0)
|
||||
{
|
||||
var data = new byte[typeNameLength];
|
||||
for (int i = 0; i < typeNameLength; i++)
|
||||
{
|
||||
@@ -435,6 +440,7 @@ namespace FlaxEngine.Utilities
|
||||
var typeName = System.Text.Encoding.ASCII.GetString(data);
|
||||
return TypeUtils.GetManagedType(typeName);
|
||||
}
|
||||
}
|
||||
if (typeNameLength > 0)
|
||||
{
|
||||
// [Deprecated on 27.08.2020, expires on 27.08.2021]
|
||||
@@ -500,6 +506,8 @@ namespace FlaxEngine.Utilities
|
||||
if (typeNameLength == int.MaxValue)
|
||||
{
|
||||
typeNameLength = stream.ReadInt32();
|
||||
if (typeNameLength > 0)
|
||||
{
|
||||
var data = new byte[typeNameLength];
|
||||
for (int i = 0; i < typeNameLength; i++)
|
||||
{
|
||||
@@ -509,6 +517,7 @@ namespace FlaxEngine.Utilities
|
||||
typeName = System.Text.Encoding.ASCII.GetString(data);
|
||||
type = TypeUtils.GetManagedType(typeName);
|
||||
}
|
||||
}
|
||||
else if (typeNameLength > 0)
|
||||
{
|
||||
// [Deprecated on 27.08.2020, expires on 27.08.2021]
|
||||
|
||||
Reference in New Issue
Block a user