Zenject - override parent dependency from subcontainer?
Maybe it'll be easier to describe this with an example.
Let's say that I have a MusicPlayer that I install in global project context, since I am going to use it on every scene. On the other hand, I don't want to load all the music clips all at once and store them in the memory since this will be a huge waste of space in RAM, so instead I only want to load music clips that I am going to use in particular scene.
Which means I should create scene context installer on every scene containing a collection of music clips. I haven't tested it, but from documentation I'd figure that these clips from scene context wouldn't be visible in project context and wouldn't be overriden on scene load.
The most straight-forward way to do this - I could get an instance of MusicPlayer in scene context installer and do something like musicPlayer.setClips(clips). The question is - what's the proper way to do this?
Given your setup, I think a reasonable way to do this might be to install a class in each SceneContext which calls musicPlayer.setClips during IInitializable.Initialize and then call musicPlayer.unsetClips during IDisposable.Dispose
Your answer
![](https://koobas.hobune.stream/wayback/20220612182009im_/https://answers.unity.com/themes/thub/images/avi.jpg)