Фабрика игрока
This commit is contained in:
1 parent
653342d080
commit
a7872a0f8c
45 files changed
+395
-168
No files matched your search
@@ -11,7 +11,12 @@ using Resolution = Reflex.Enums.Resolution;
|
||||
|
||||
namespace Code.Example.Platformer
|
||||
{
|
||||
public class PlatformerEnemySceneInstaller : MonoBehaviour, IInstaller, IPlatformerEnemyFactoryInitializedHandle
|
||||
public class PlatformerEnemySceneInstaller :
|
||||
MonoBehaviour,
|
||||
IInstaller,
|
||||
IPlatformerEnemyFactoryInitializedHandle,
|
||||
IPlatformerPlayerFactoryInitializedHandle,
|
||||
IDisposable
|
||||
{
|
||||
// [SerializeField] private PlatformerCanvas gameplayPlatformerCanvas;
|
||||
[SerializeField] private PlatformerFirstLevelData firstLevelData;
|
||||
@@ -27,14 +32,16 @@ namespace Code.Example.Platformer
|
||||
public void InstallBindings(ContainerBuilder containerBuilder)
|
||||
{
|
||||
// Enemies
|
||||
// Player
|
||||
// Container
|
||||
_sceneInit = new(2, LoadingComplete);
|
||||
_sceneInit = new(3, LoadingComplete);
|
||||
|
||||
// containerBuilder.RegisterValue(gameplayPlatformerCanvas);
|
||||
containerBuilder.Parent.Resolve<EventBus>().Subscribe(this);
|
||||
|
||||
containerBuilder.RegisterValue(firstLevelData);
|
||||
containerBuilder.RegisterType(typeof(PlatformerEnemyFactory), new []{typeof(IPlatformerEnemyFactory)}, Lifetime.Scoped, Resolution.Eager);
|
||||
containerBuilder.RegisterType(typeof(PlatformerPlayerFactory), new []{typeof(IPlatformerPlayerFactory)}, Lifetime.Scoped, Resolution.Eager);
|
||||
containerBuilder.OnContainerBuilt += OnContainerBuild;
|
||||
}
|
||||
private Container _container;
|
||||
@@ -51,5 +58,15 @@ namespace Code.Example.Platformer
|
||||
{
|
||||
_sceneInit.DoProgress();
|
||||
}
|
||||
|
||||
public void PlatformerPlayerFactoryInitialized()
|
||||
{
|
||||
_sceneInit.DoProgress();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_container.Resolve<EventBus>().Unsubscribe(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user