DEV Community

Discussion on: Advanced scenes management in Unity

rahilp profile image
Rahil Patel • Edited on

Hi there, great post! Nice basis for passing dependencies between scenes.

By the way, I believe the code for SceneManager.OpenSceneWithArgs skips storing non-null SceneArgs instances in the dictionary, meaning loaded SceneController instances will only receive uninitialized instances. Perhaps a fix:

args.Add(type, sceneArgs ?? new TArgs { IsNull = true });
Enter fullscreen mode Exit fullscreen mode