This commit is contained in:
vis2k 2021-08-17 17:18:13 +08:00
parent f64b808aed
commit 3c5a9de323

View File

@ -76,18 +76,14 @@ public static bool ImplementsInterface<TInterface>(this TypeDefinition td)
return false;
}
public static bool IsMultidimensionalArray(this TypeReference tr)
{
return tr is ArrayType arrayType && arrayType.Rank > 1;
}
public static bool IsMultidimensionalArray(this TypeReference tr) =>
tr is ArrayType arrayType && arrayType.Rank > 1;
// Does type use netId as backing field
public static bool IsNetworkIdentityField(this TypeReference tr)
{
return tr.Is<UnityEngine.GameObject>()
|| tr.Is<NetworkIdentity>()
|| tr.IsDerivedFrom<NetworkBehaviour>();
}
public static bool IsNetworkIdentityField(this TypeReference tr) =>
tr.Is<UnityEngine.GameObject>() ||
tr.Is<NetworkIdentity>() ||
tr.IsDerivedFrom<NetworkBehaviour>();
public static bool CanBeResolved(this TypeReference parent)
{