bool ContainsReferenceType(int typeIndex) { var baseType = m_Snapshot.managedTypes[typeIndex]; if (!baseType.isValueType) { return(true); } var managedTypesLength = m_Snapshot.managedTypes.Length; var instanceFields = baseType.instanceFields; for (int n = 0, nend = instanceFields.Length; n < nend; ++n) { var fieldTypeIndex = instanceFields[n].managedTypesArrayIndex; if (fieldTypeIndex < 0 || fieldTypeIndex >= managedTypesLength) { m_Snapshot.Error("'{0}' field '{1}' is out of bounds '{2}', ignoring.", baseType.name, n, fieldTypeIndex); continue; } var fieldType = m_Snapshot.managedTypes[instanceFields[n].managedTypesArrayIndex]; if (!fieldType.isValueType) { return(true); } } return(false); }