Skip to content

Commit

Permalink
fix(mmextensions): removing the DontDestroyOnLoad for now
Browse files Browse the repository at this point in the history
  • Loading branch information
h0lybyte committed Nov 27, 2024
1 parent a971574 commit a44d5f2
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions packages/mmextensions/mmextensions/Shaco/GameLifetimeScope.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,17 @@ protected override void Configure(IContainerBuilder builder)
var cameraInstance = Object.Instantiate(cameraPrefab);
cameraInstance.transform.parent = null;
builder.RegisterInstance(cameraInstance).AsSelf();
DontDestroyOnLoad(cameraInstance);
// DontDestroyOnLoad(cameraInstance);

builder.RegisterComponentInNewPrefab<GameManager>(gameManagerPrefab, Lifetime.Scoped).DontDestroyOnLoad();
builder.RegisterComponentInNewPrefab<MMTimeManager>(timeManagerPrefab, Lifetime.Singleton).DontDestroyOnLoad();
builder.RegisterComponentInNewPrefab<MMSoundManager>(soundManagerPrefab, Lifetime.Singleton).DontDestroyOnLoad();


builder.RegisterComponentInNewPrefab<GameManager>(gameManagerPrefab, Lifetime.Scoped);
builder.RegisterComponentInNewPrefab<MMTimeManager>(timeManagerPrefab, Lifetime.Singleton);
builder.RegisterComponentInNewPrefab<MMSoundManager>(soundManagerPrefab, Lifetime.Singleton);

// builder.RegisterComponentInNewPrefab<GameManager>(gameManagerPrefab, Lifetime.Scoped).DontDestroyOnLoad();
// builder.RegisterComponentInNewPrefab<MMTimeManager>(timeManagerPrefab, Lifetime.Singleton).DontDestroyOnLoad();
// builder.RegisterComponentInNewPrefab<MMSoundManager>(soundManagerPrefab, Lifetime.Singleton).DontDestroyOnLoad();
// builder.RegisterComponentInNewPrefab<GameObject>(cameraPrefab, Lifetime.Singleton).DontDestroyOnLoad();

builder.RegisterEntryPoint<GameManagerEntryPoint>();
Expand Down

0 comments on commit a44d5f2

Please sign in to comment.