files arranged using assembly defn
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
using Darkmatter.Core;
|
||||
using UnityEngine;
|
||||
using VContainer;
|
||||
using VContainer.Unity;
|
||||
|
||||
namespace Darkmatter.Presentation
|
||||
{
|
||||
public class StartScreenController : IStartable
|
||||
{
|
||||
private StartScreenView startScreenView;
|
||||
[Inject] IGameScreenController gameScreenController;
|
||||
[Inject] IInputReader IinputReader;
|
||||
[Inject] private IAudioController IaudioController;
|
||||
[Inject] private IGameSession IgameSession;
|
||||
public StartScreenController(StartScreenView _startScreenView, IGameScreenController _gameScreenController)
|
||||
{
|
||||
Debug.Log("StartScreenController Constructor Called");
|
||||
startScreenView = _startScreenView;
|
||||
gameScreenController = _gameScreenController;
|
||||
startScreenView.tapToStartButton.onClick.AddListener(OnTapToStartButtonClicked);
|
||||
}
|
||||
public void Start()
|
||||
{
|
||||
if (IgameSession.showStartScreen)
|
||||
{
|
||||
startScreenView.Show();
|
||||
IinputReader.LockInput();
|
||||
IgameSession.showStartScreen = false;
|
||||
IgameSession.hasGameStarted = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
gameScreenController.ShowGameScreen();
|
||||
IgameSession.hasGameStarted = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void OnTapToStartButtonClicked()
|
||||
{
|
||||
IaudioController.PlayBtnPressedSound();
|
||||
startScreenView.Hide();
|
||||
IinputReader.UnlockInput();
|
||||
gameScreenController.ShowGameScreen();
|
||||
IgameSession.hasGameStarted = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user