simple UI added
This commit is contained in:
37
Assets/Scripts/UI/StartScreenController.cs
Normal file
37
Assets/Scripts/UI/StartScreenController.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using UnityEngine;
|
||||
using VContainer;
|
||||
|
||||
public class StartScreenController
|
||||
{
|
||||
private StartScreenView _view;
|
||||
public bool hasGameStarted = false;
|
||||
|
||||
public StartScreenController(StartScreenView view)
|
||||
{
|
||||
_view = view;
|
||||
_view.playBtn.onClick.AddListener(OnPlayBtnClicked);
|
||||
Debug.Log("Instance");
|
||||
}
|
||||
|
||||
|
||||
public void OnPlayBtnClicked()
|
||||
{
|
||||
_view.Hide();
|
||||
hasGameStarted = true;
|
||||
}
|
||||
|
||||
public void ShowStartScreen()
|
||||
{
|
||||
|
||||
_view.Show();
|
||||
hasGameStarted = false;
|
||||
|
||||
}
|
||||
|
||||
public void HideStartScreen()
|
||||
{
|
||||
_view.Hide();
|
||||
hasGameStarted = true;
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user