#1
|
|||
|
|||
OnChat event by reflection
We now that the GameDef class has a "Chat" event that is raised for every chat message. However GameDef is not accessible from the mission script. I'm pretty sure from my AddIn work that the GamePlay object that is accessible from the mission script actually is derived from GameDef, however casting it to GameDef is not possible as this class is not marked as Serializable (you can't create a instance of GameDef).
So basically GamePlay should have the "Chat" event, only the compiler prevents us from using it. It could be possible to use reflection to register our own OnChat method to this event. http://msdn.microsoft.com/en-us/library/ms228976.aspx Any thoughts? |
|
|