UnityEditor.MonoAssemblyStripping.DoesTypeEnheritFrom C# (CSharp) Method

DoesTypeEnheritFrom() private static method

private static DoesTypeEnheritFrom ( TypeReference type, string typeName ) : bool
type Mono.Cecil.TypeReference
typeName string
return bool
        private static bool DoesTypeEnheritFrom(TypeReference type, string typeName)
        {
            while (type != null)
            {
                if (type.FullName == typeName)
                {
                    return true;
                }
                type = type.Resolve().BaseType;
            }
            return false;
        }

Usage Example

 private static void CollectBlackListTypes(HashSet <TypeDefinition> typesToPreserve, IList <TypeDefinition> types, List <string> baseTypes)
 {
     if (types == null)
     {
         return;
     }
     using (IEnumerator <TypeDefinition> enumerator1 = ((IEnumerable <TypeDefinition>)types).GetEnumerator())
     {
         while (((IEnumerator)enumerator1).MoveNext())
         {
             TypeDefinition current1 = enumerator1.Current;
             if (current1 != null)
             {
                 using (List <string> .Enumerator enumerator2 = baseTypes.GetEnumerator())
                 {
                     while (enumerator2.MoveNext())
                     {
                         string current2 = enumerator2.Current;
                         if (MonoAssemblyStripping.DoesTypeEnheritFrom((TypeReference)current1, current2))
                         {
                             typesToPreserve.Add(current1);
                             break;
                         }
                     }
                 }
                 MonoAssemblyStripping.CollectBlackListTypes(typesToPreserve, (IList <TypeDefinition>)current1.get_NestedTypes(), baseTypes);
             }
         }
     }
 }
All Usage Examples Of UnityEditor.MonoAssemblyStripping::DoesTypeEnheritFrom