added sound script and menu
This commit is contained in:
38
Assets/Scripts/UI/GameScreenController.cs
Normal file
38
Assets/Scripts/UI/GameScreenController.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SocialPlatforms.Impl;
|
||||
using VContainer;
|
||||
|
||||
public class GameScreenController
|
||||
{
|
||||
private GameScreenView gameScreenView;
|
||||
[Inject] private PauseScreenController pauseScreenController;
|
||||
|
||||
public GameScreenController (GameScreenView gameScreenView)
|
||||
{
|
||||
this.gameScreenView = gameScreenView;
|
||||
this.gameScreenView.pauseBtn.onClick.AddListener(PauseBtnClicked);
|
||||
}
|
||||
|
||||
public void ShowGameScreen()
|
||||
{
|
||||
gameScreenView.Show();
|
||||
}
|
||||
public void HideGameScreen()
|
||||
{
|
||||
gameScreenView.Hide();
|
||||
}
|
||||
|
||||
private void PauseBtnClicked()
|
||||
{
|
||||
Time.timeScale = 0;
|
||||
pauseScreenController.ShowPauseScreen();
|
||||
}
|
||||
|
||||
public void UpdateScore(int score)
|
||||
{
|
||||
gameScreenView.SetScore(score);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user