public LuaEventHandler GetEvent(Type eventHandlerType, LuaFunction eventHandler)
{
Type eventConsumerType;
if (eventHandlerCollection.ContainsKey(eventHandlerType))
{
eventConsumerType=eventHandlerCollection[eventHandlerType];
}
else
{
eventConsumerType=GenerateEvent(eventHandlerType);
eventHandlerCollection[eventHandlerType] = eventConsumerType;
}
LuaEventHandler luaEventHandler=(LuaEventHandler)Activator.CreateInstance(eventConsumerType);
luaEventHandler.handler=eventHandler;
return luaEventHandler;
}