mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
GetReadFunc: use actual types. less magic.
This commit is contained in:
parent
2def424a8a
commit
7161126e67
@ -267,14 +267,14 @@ public static MethodReference GetReadFunc(TypeReference variable)
|
||||
{
|
||||
if (lists.readFuncs.ContainsKey(variable.FullName))
|
||||
{
|
||||
var foundFunc = lists.readFuncs[variable.FullName];
|
||||
MethodReference foundFunc = lists.readFuncs[variable.FullName];
|
||||
if (foundFunc.ReturnType.IsArray == variable.IsArray)
|
||||
{
|
||||
return foundFunc;
|
||||
}
|
||||
}
|
||||
|
||||
var td = variable.Resolve();
|
||||
TypeDefinition td = variable.Resolve();
|
||||
if (td == null)
|
||||
{
|
||||
Log.Error("GetReadFunc unsupported type " + variable.FullName);
|
||||
@ -292,8 +292,8 @@ public static MethodReference GetReadFunc(TypeReference variable)
|
||||
|
||||
if (variable.IsArray)
|
||||
{
|
||||
var elementType = variable.GetElementType();
|
||||
var elementReadFunc = GetReadFunc(elementType);
|
||||
TypeReference elementType = variable.GetElementType();
|
||||
MethodReference elementReadFunc = GetReadFunc(elementType);
|
||||
if (elementReadFunc == null)
|
||||
{
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user