Files
2026-01-20 20:38:20 +03:00

34 lines
1016 B
C#

using Code.Infrastructure.SceneLoader;
using UnityEngine;
using UnityEngine.SceneManagement;
namespace Code.Infrastructure.App.States
{
[State(typeof(AppStates),typeof(AppStateMachineContext))]
[StateRaisingEvent]
public partial class BootstrapState : IOnGameplaySceneLoadedHandler
{
private EventBus.EventBus _eventBus;
public BootstrapState(AppStateMachineContext context, EventBus.EventBus eventBus) : base(context,eventBus)
{
_eventBus = eventBus;
}
public override AppStates myState => AppStates.Bootstrap;
protected override void OnEnterState()
{
_eventBus.Subscribe(this);
Context.SceneLoader.LoadSceneAsync(SceneId.Gameplay, LoadSceneMode.Single).Forget();
}
protected override void OnExitState()
{
_eventBus.Unsubscribe(this);
}
public void OnGameplaySceneLoaded()
{
Debug.Log("Spermageddon");
}
}
}