Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unloading individual content #6164

Open
kimimaru4000 opened this issue Jan 25, 2018 · 4 comments
Open

Unloading individual content #6164

kimimaru4000 opened this issue Jan 25, 2018 · 4 comments

Comments

@kimimaru4000
Copy link
Contributor

kimimaru4000 commented Jan 25, 2018

MonoGame currently does not support unloading content individually, which is a feature I feel can be useful for a variety of reasons. I'll list several use-cases:

  1. Playing a cutscene that has one new asset that needs to be loaded just for that cutscene.
  2. Unloading a single shader that no longer needs to be used.
  3. Wanting to unload some assets without unloading every asset.

These can be done with multiple ContentManagers, but that seems overkill if you have only a few assets that you'd need for a specific purpose.

I suggest we can either add an overload to Unload with the following signature:

public virtual void Unload(string assetName)

or add a new method:

public virtual void UnloadAsset(string assetName)

Thoughts?

@kimimaru4000
Copy link
Contributor Author

I'm going to look more into this. @Jjagg I vaguely recall a while back you said that models may be problematic because this method would have to also unload anything related to them, such as textures. What if we make it clear that it's unloading only a single asset and not anything else?

@Jjagg
Copy link
Contributor

Jjagg commented Feb 15, 2019

I'm fine with adding the method. It's something that comes up every once in a while.

This has been a discussion point before though, so I'd like other people to weigh in.

@tomspilman @cra0zy

@mrhelmut
Copy link
Contributor

Definitely something that would prove useful. I keep hearing from devs who re-implement their own content manager because of this.

@harry-cpp
Copy link
Member

Agreed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants