c# - An Example about XNA UnloadContent -


When I use XNA to create a game, I see zero unload content, but how do I use it Can someone give me an example of unload content and can show it in the last game? Thanks a lot.

If you are loading in any resources that need to be settled, you will do so For example, in the unload content , you have a file that you want to keep it open after you load it.

  Private filestream _myFileStream; Private zero load content () {_myFileStream = File.Open ("myLevelDataThatIKeepOpen.lvl", FileMode.Append); } Private zero unload content () {if (_myFileStream! = Null) {_myFileStream.Close (); _myFileStream.Dispose (); }}  

Specifically, it is for content that you manage outside the Content Manager.


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -