2022-09-26 22:44:56 +02:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
|
|
public class OpenSettingsOnESCPress : MonoBehaviour
|
|
|
|
{
|
|
|
|
public GameObject SettingsMainPanel;
|
|
|
|
public GameObject SettingsPanel;
|
|
|
|
public GameObject SoundsPanel;
|
|
|
|
public GameObject ControlsPanel;
|
|
|
|
public GameObject LanguagePanel;
|
|
|
|
|
|
|
|
void Update()
|
|
|
|
{
|
2023-01-07 19:58:08 +01:00
|
|
|
//KeyCode keyToSettings = (KeyCode) System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("Settings"));
|
|
|
|
if (Input.GetKeyUp(KeyCode.Escape))
|
2022-09-26 22:44:56 +02:00
|
|
|
{
|
|
|
|
if ((SettingsMainPanel.active == false) && (SettingsPanel.active == false) && (SoundsPanel.active == false) && (ControlsPanel.active == false) && (LanguagePanel.active == false))
|
|
|
|
{
|
|
|
|
SettingsMainPanel.SetActive(true);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SettingsMainPanel.SetActive(false);
|
|
|
|
SettingsPanel.SetActive(false);
|
|
|
|
SoundsPanel.SetActive(false);
|
|
|
|
ControlsPanel.SetActive(false);
|
|
|
|
LanguagePanel.SetActive(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|