On-screen controls
This commit is contained in:
22
Assets/Scripts/UI/GamplayOnscreenControls.cs
Normal file
22
Assets/Scripts/UI/GamplayOnscreenControls.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class GamplayOnscreenControls : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private GameObject uiContainer;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
uiContainer.SetActive(false);
|
||||
GameManager.Instance.GameStateChanged += OnGameStateChanged;
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
GameManager.Instance.GameStateChanged -= OnGameStateChanged;
|
||||
}
|
||||
|
||||
private void OnGameStateChanged(GameState newState)
|
||||
{
|
||||
uiContainer.SetActive(newState == GameState.Gameplay);
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/UI/GamplayOnscreenControls.cs.meta
Normal file
11
Assets/Scripts/UI/GamplayOnscreenControls.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 12f193df5b2ac6c4db99918efaf29746
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user