@@ -42,37 +42,5 @@ public class GenericScriptableObject : ScriptableObject
4242 {
4343 return ( T ) CreateInstance ( typeof ( T ) ) ;
4444 }
45-
46- /// <summary>
47- /// Creates an instance of <see cref="GenericScriptableObject"/> using a generic type definition
48- /// (generic type without generic argument types) and an array of generic argument types.
49- /// </summary>
50- /// <param name="genericTypeWithoutTypeParams">
51- /// Generic type derived from <see cref="GenericScriptableObject"/> without generic argument types (e.g. Generic<,>).
52- /// </param>
53- /// <param name="paramTypes">Types of the generic arguments.</param>
54- /// <returns>
55- /// Instance of <paramref name="genericTypeWithoutTypeParams"/> with param types <paramref name="paramTypes"/>>.
56- /// </returns>
57- /// <exception cref="ArgumentException">
58- /// If the number of generic argument types passed into the method is not equal to the number of generic
59- /// arguments the type can take.
60- /// </exception>
61- [ PublicAPI , CanBeNull , Pure ]
62- public static GenericScriptableObject CreateInstance ( Type genericTypeWithoutTypeParams , params Type [ ] paramTypes )
63- {
64- int genericArgCount = genericTypeWithoutTypeParams . GetGenericArguments ( ) . Length ;
65- int paramTypesCount = paramTypes . Length ;
66-
67- if ( genericArgCount != paramTypesCount )
68- {
69- throw new ArgumentException (
70- $ "Number of generic argument types ({ paramTypesCount } ) is not equal to the number of " +
71- $ "generic arguments the type can take ({ genericArgCount } ).", nameof ( genericTypeWithoutTypeParams ) ) ;
72- }
73-
74- Type genericType = genericTypeWithoutTypeParams . MakeGenericType ( paramTypes ) ;
75- return ( GenericScriptableObject ) CreateInstance ( genericType ) ;
76- }
7745 }
7846}
0 commit comments