最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

dependency injection - Unity Extenject how to properly organize access from SceneContext to ProjectContext - Stack Overflow

programmeradmin3浏览0评论

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 anize 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.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论