If you add a Configure or Initialize function to a generic class it will cause a runtime exception. To fix this make the following changes in ScriptCompiler.cs under the function Invoke( string method )
While it is possible to execute Configure/Initialize method for all constructed types by executing it from the generic itself, it is not advisable.
Code:
public static void Invoke( string method )
{
List<MethodInfo> invoke = new List<MethodInfo>();
for( int a = 0; a < m_Assemblies.Length; ++a )
{
Type[] types = m_Assemblies[a].GetTypes();
for( int i = 0; i < types.Length; ++i )
{
Type type = types[i];
if ( !type.IsGenericType )
{
MethodInfo m = type.GetMethod( method, BindingFlags.Static | BindingFlags.Public );
if( m != null )
invoke.Add( m );
}
}
}
invoke.Sort( new CallPriorityComparer() );
for( int i = 0; i < invoke.Count; ++i )
invoke[i].Invoke( null, null );
}
While it is possible to execute Configure/Initialize method for all constructed types by executing it from the generic itself, it is not advisable.