input refactored
This commit is contained in:
@@ -12,6 +12,7 @@ public class DeathScreenController:IDeathScreenController
|
||||
[Inject] private IInputReader IinputReader;
|
||||
[Inject] private IAudioController IaudioController;
|
||||
[Inject] private IGameSession IgameSession;
|
||||
[Inject] private IGameScreenController IgameScreenController;
|
||||
public DeathScreenController(DeathScreenView _deathScreenView)
|
||||
{
|
||||
deathScreenView = _deathScreenView;
|
||||
@@ -21,6 +22,7 @@ public class DeathScreenController:IDeathScreenController
|
||||
|
||||
public void ShowDeathScreen()
|
||||
{
|
||||
IgameScreenController.HideGameScreen();
|
||||
deathScreenView.Show(IscoreService.score,IscoreService.highScore);
|
||||
}
|
||||
|
||||
@@ -38,6 +40,7 @@ public class DeathScreenController:IDeathScreenController
|
||||
Debug.Log("Restart Button Clicked");
|
||||
IinputReader.UnlockInput();
|
||||
IaudioController.PlayBtnPressedSound();
|
||||
IgameSession.showStartScreen = false;
|
||||
SceneManager.LoadScene(0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,11 @@ public class GameScreenController: IGameScreenController
|
||||
gameScreenView.Show();
|
||||
}
|
||||
|
||||
public void HideGameScreen()
|
||||
{
|
||||
gameScreenView.Hide();
|
||||
}
|
||||
|
||||
public void OnPauseButtonClicked()
|
||||
{
|
||||
IaudioController.PlayBtnPressedSound();
|
||||
@@ -45,4 +50,5 @@ public class GameScreenController: IGameScreenController
|
||||
|
||||
public interface IGameScreenController {
|
||||
void ShowGameScreen();
|
||||
void HideGameScreen();
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ public class PauseScreenController:IPauseScreenController
|
||||
private PauseScreenView pauseScreenView;
|
||||
[Inject] private IInputReader IinputReader;
|
||||
[Inject] private IAudioController IaudioController;
|
||||
[Inject] private IGameSession IgameSession;
|
||||
|
||||
public PauseScreenController(PauseScreenView _pauseScreenView)
|
||||
{
|
||||
@@ -26,6 +27,7 @@ public class PauseScreenController:IPauseScreenController
|
||||
Time.timeScale = 1.0f;
|
||||
IinputReader.UnlockInput();
|
||||
IaudioController.PlayBtnPressedSound();
|
||||
IgameSession.showStartScreen = false;
|
||||
SceneManager.LoadScene(0); //Restart This Scene
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user