Assets/Watson/Scripts/Utilities/Utility.cs
/// <summary>
/// This helper functions returns all Type's that inherit from the given type.
/// </summary>
/// <param name="type">The Type to find all types that inherit from the given type.</param>
/// <returns>A array of all Types that inherit from type.</returns>
This helper functions returns all Type's that inherit from the given type.
This helper functions returns all Type ' s that inherit from the given type .
public static Type[] FindAllDerivedTypes(Type type)
        {
            List<Type> types = new List<Type>();
            foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
            {
                foreach (var t in assembly.GetTypes())
                {
                    if (t == type || t.IsAbstract)
                        continue;
                    if (type.IsAssignableFrom(t))
                        types.Add(t);
                }
            }
            return types.ToArray();
        }
public static Type [ ] FindAllDerivedTypes ( Type type ) { List < Type > types = new List < Type > ( ) ; foreach ( var assembly in AppDomain . CurrentDomain . GetAssemblies ( ) ) { foreach ( var t in assembly . GetTypes ( ) ) { if ( t == type || t . IsAbstract ) continue ; if ( type . IsAssignableFrom ( t ) ) types . Add ( t ) ; } } return types . ToArray ( ) ; }
This helper functions returns all Type's that inherit from the given type.
This helper functions returns all Type ' s that inherit from the given type .
A array of all Types that inherit from type.
A array of all Types that inherit from type .
type
Type
The Type to find all types that inherit from the given type.
The Type to find all types that inherit from the given type .