37 lines
1004 B
C#
37 lines
1004 B
C#
using System.Collections.Generic;
|
|
using Code.Infrastructure.App;
|
|
using Code.Infrastructure.SceneLoader;
|
|
using Reflex.Attributes;
|
|
using UnityEngine;
|
|
using UnityEngine.SceneManagement;
|
|
using UnityEngine.UI;
|
|
|
|
namespace Code.Debug
|
|
{
|
|
public class SceneChooser : MonoBehaviour
|
|
{
|
|
[Inject] private SceneLoader _sceneLoader;
|
|
[Inject] private AppStateMachine _stateMachine;
|
|
public void ChooseScene(int id)
|
|
{
|
|
_sceneLoader.LoadSceneAsync((SceneId)id, LoadSceneMode.Additive).Forget();
|
|
}
|
|
|
|
public void ChooseState(int id)
|
|
{
|
|
_stateMachine.SwitchState((AppStates)id);
|
|
}
|
|
|
|
public void SwitchPlatformer()
|
|
{
|
|
_stateMachine.SwitchState(AppStates.Platformer).AllowStateTransition(AppStates.MainMenu);
|
|
}
|
|
|
|
[SerializeField] private List<Button> buttons;
|
|
|
|
public void EnableButtons()
|
|
{
|
|
foreach (var button in buttons) button.interactable = true;
|
|
}
|
|
}
|
|
} |