35 lines
899 B
C#
35 lines
899 B
C#
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");
|
|
}
|
|
}
|