diff --git a/Assets/Scripts/Installers/GlobalInstaller.cs b/Assets/Scripts/Installers/GlobalInstaller.cs index 8263081e..8338f583 100644 --- a/Assets/Scripts/Installers/GlobalInstaller.cs +++ b/Assets/Scripts/Installers/GlobalInstaller.cs @@ -5,6 +5,8 @@ using Zenject; public class GlobalInstaller : MonoInstaller { + + [SerializeField] private GameObject musicPlayerPrefab; @@ -14,20 +16,39 @@ public class GlobalInstaller : MonoInstaller [SerializeField] private GameObject playerPrefab; + public override void Start() + { + base.Start(); + + name = "ProjectContext"; + } + public override void InstallBindings() { Container.Bind() .FromComponentInNewPrefab(musicPlayerPrefab) - .AsSingle(); + .AsSingle() + .OnInstantiated((ctx, obj) => + { + obj.name = musicPlayerPrefab.name; + }); Container.Bind() .FromComponentInNewPrefab(hvrGlobalPrefab) .AsSingle() + .OnInstantiated((ctx, obj) => + { + obj.name = hvrGlobalPrefab.name; + }) .NonLazy(); Container.Bind() .FromComponentInNewPrefab(playerPrefab) .AsSingle() + .OnInstantiated((ctx, obj) => + { + obj.name = playerPrefab.name; + }) .NonLazy(); } } \ No newline at end of file diff --git a/Assets/Scripts/Installers/LevelInstaller.cs b/Assets/Scripts/Installers/LevelInstaller.cs index 9bcf40fc..4b41739b 100644 --- a/Assets/Scripts/Installers/LevelInstaller.cs +++ b/Assets/Scripts/Installers/LevelInstaller.cs @@ -15,6 +15,10 @@ public class LevelInstaller : MonoInstaller Container.Bind() .FromComponentsInNewPrefabResource("Managers/LevelManager") .AsSingle() + .OnInstantiated((ctx, obj) => + { + obj.name = "LevelManager"; + }) .NonLazy(); } } \ No newline at end of file