View Single Post
  #24  
Old 08-10-2011, 06:33 AM
41Sqn_Banks 41Sqn_Banks is offline
Approved Member
 
Join Date: Oct 2007
Posts: 644
Default

Did you check if GamePlay is null before the cast?

Basicly you can do the cast using
Code:
maddox.game.GameDef game = (maddox.game.GameDef)GamePlay;
- this will cause a exception if cast fails

or
Code:
maddox.game.GameDef game = GamePlay as maddox.game.GameDef;
- this will return null if cast fails.

I tried both and both did work. Of course I still get the serialization exception.
Reply With Quote