Add lobby and scene managers, implement scene switching with fade in/out
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using HurricaneVR.Framework.Core;
|
||||
using HurricaneVR.Framework.Core.Player;
|
||||
using HurricaneVR.Framework.Core.Utils;
|
||||
using UnityEngine;
|
||||
using Zenject;
|
||||
@@ -16,6 +17,9 @@ public class GlobalInstaller : MonoInstaller
|
||||
[SerializeField]
|
||||
private GameObject playerPrefab;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject sceneManagerPrefab;
|
||||
|
||||
public override void Start()
|
||||
{
|
||||
base.Start();
|
||||
@@ -42,12 +46,21 @@ public class GlobalInstaller : MonoInstaller
|
||||
})
|
||||
.NonLazy();
|
||||
|
||||
Container.Bind<HVRObjectCollisionDisabler>()
|
||||
Container.Bind<HVRPlayerController>()
|
||||
.FromComponentInNewPrefab(playerPrefab)
|
||||
.AsSingle()
|
||||
.OnInstantiated<HVRObjectCollisionDisabler>((ctx, obj) =>
|
||||
.OnInstantiated<HVRPlayerController>((ctx, obj) =>
|
||||
{
|
||||
obj.name = playerPrefab.name;
|
||||
obj.transform.parent.name = playerPrefab.name;
|
||||
})
|
||||
.NonLazy();
|
||||
|
||||
Container.Bind<SceneManager>()
|
||||
.FromComponentInNewPrefab(sceneManagerPrefab)
|
||||
.AsSingle()
|
||||
.OnInstantiated<SceneManager>((ctx, obj) =>
|
||||
{
|
||||
obj.name = sceneManagerPrefab.name;
|
||||
})
|
||||
.NonLazy();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user