This commit is contained in:
ThomasCharester committed 2026-01-26 13:29:35 +03:00
1 parent 0f0c8bab43
commit b7527d8d68
40 files changed
+2636 -795

No files matched your search

@@ -1,6 +1,7 @@
using Code.Infrastructure.Camera;
using Code.Infrastructure.Generators;
using Code.Infrastructure.SceneLoader;
using Code.Infrastructure.UI;
using Cysharp.Threading.Tasks;
using UnityEngine;
using UnityEngine.SceneManagement;
@@ -9,7 +10,7 @@ namespace Code.Infrastructure.App.States
{
[State(typeof(AppStates),typeof(AppStateMachineContext))]
[StateRaisingEvent]
public partial class BootstrapState : IOnGameplaySceneLoadedHandler
public partial class BootstrapState : IOnGameplaySceneLoadedHandler, IUIPanelLoaded
{
private EventBus.EventBus _eventBus;
public BootstrapState(AppStateMachineContext context, EventBus.EventBus eventBus) : base(context,eventBus)
@@ -21,11 +22,14 @@ namespace Code.Infrastructure.App.States
protected override void OnEnterState()
{
_eventBus.Subscribe(this);
Context.SceneLoader.LoadSceneAsync(SceneId.Gameplay, LoadSceneMode.Single).Forget();
Context.UIService.TryLoadPanel(UIPanelType.DebugSceneChooser);
// Context.SceneLoader.LoadSceneAsync(SceneId.Gameplay, LoadSceneMode.Single).Forget();
}
protected override void OnExitState()
{
Context.UIService.TryRemovePanel(UIPanelType.DebugSceneChooser);
_eventBus.Unsubscribe(this);
}
@@ -33,5 +37,12 @@ namespace Code.Infrastructure.App.States
{
}
public void UILoaded(UIPanelType uiPanelType)
{
if (uiPanelType != UIPanelType.DebugSceneChooser) return;
Context.UIService.OpenPanel(uiPanelType);
}
}
}