Vladyslav Yeromenko
Vladyslav Yeromenko

Reputation: 1

Unity Extenject how to properly organize access from SceneContext to ProjectContext

I have a question about architecture with Extenject (Zenject).

I have a GameStateMachine that is located in the ProjectContext and manages the game states. One of these states (LoadGameState) needs access to PlayerChooseService, which exists only in SceneContext.

The PlayerChooseService stores the player's choices and is needed to unload the resources that the player selected during loading.

How to organize access to the service from the SceneContext to the GameStateMachine, which is located in the ProjectContext?

I know a bunch of different approaches (SignalBus, Factory, etc.) that can be used to do this, but I want to know how to do it right.

Upvotes: 0

Views: 13

Answers (0)

Related Questions