added sounds
This commit is contained in:
34
Assets/Scripts/UI/DeathScreenController.cs
Normal file
34
Assets/Scripts/UI/DeathScreenController.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using VContainer;
|
||||
using VContainer.Unity;
|
||||
|
||||
public class DeathScreenController
|
||||
{
|
||||
private DeathScreenView deathScreenView;
|
||||
public event Action OnRestartPressed;
|
||||
public event Action OnExitPressed;
|
||||
|
||||
[Inject] private ScoreService scoreService;
|
||||
public DeathScreenController(DeathScreenView _deathScreenView)
|
||||
{
|
||||
deathScreenView = _deathScreenView;
|
||||
deathScreenView.restartBtn.onClick.AddListener(() => OnRestartPressed?.Invoke());
|
||||
deathScreenView.exitBtn.onClick.AddListener(()=>OnExitPressed?.Invoke());
|
||||
}
|
||||
|
||||
public void ShowDeathScreen()
|
||||
{
|
||||
deathScreenView.Show(scoreService.score,scoreService.highScore);
|
||||
}
|
||||
|
||||
private void OnExitButtonClicked()
|
||||
{
|
||||
Debug.Log("Exit Button Clicked");
|
||||
}
|
||||
|
||||
private void OnRestartButtonClicked()
|
||||
{
|
||||
Debug.Log("Restart Button Clicked");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user