2022-11-16 11:23:25 +01:00
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEngine.SceneManagement;
|
|
|
|
|
|
|
|
|
|
public class MainMenu : MonoBehaviour
|
|
|
|
|
{
|
2023-02-10 16:13:26 +01:00
|
|
|
public GameObject MainMenuObj;
|
|
|
|
|
public GameObject OptionsMenu;
|
2023-04-12 21:22:45 +02:00
|
|
|
public GameObject CreditsMenuObj;
|
2023-02-10 16:13:26 +01:00
|
|
|
public GameObject VideoButton;
|
|
|
|
|
|
2023-04-13 09:54:21 +02:00
|
|
|
private AudioManager audioManager;
|
|
|
|
|
|
|
|
|
|
private void Awake() {
|
|
|
|
|
audioManager = FindObjectOfType<AudioManager>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Start() {
|
|
|
|
|
audioManager.Play("MenuMusic");
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-10 16:13:26 +01:00
|
|
|
public void PlayGame()
|
|
|
|
|
{
|
2022-11-16 11:23:25 +01:00
|
|
|
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
|
|
|
|
|
}
|
2022-11-18 10:12:04 +01:00
|
|
|
|
2023-02-10 16:13:26 +01:00
|
|
|
public void QuitGame()
|
|
|
|
|
{
|
2022-11-18 10:12:04 +01:00
|
|
|
Debug.Log("Application is quitting!!");
|
|
|
|
|
Application.Quit();
|
|
|
|
|
}
|
2023-01-25 11:18:48 +01:00
|
|
|
|
2023-02-10 16:13:26 +01:00
|
|
|
public void GoToMenu()
|
|
|
|
|
{
|
2023-01-25 11:18:48 +01:00
|
|
|
SceneManager.LoadScene("MainMenu");
|
|
|
|
|
}
|
2023-02-10 16:13:26 +01:00
|
|
|
|
|
|
|
|
public void OptionMenu()
|
|
|
|
|
{
|
|
|
|
|
MainMenuObj.SetActive(false); //kikapcsolni a fomenu dolgokat
|
|
|
|
|
OptionsMenu.SetActive(true); //bekapcsolni a beallitas menu dolgokat
|
|
|
|
|
|
|
|
|
|
//megvizsgalni hogy a platform szamitogep, es ha nem csak a hangerot lehessen allitani
|
|
|
|
|
if (Application.platform == RuntimePlatform.WindowsPlayer || Application.platform == RuntimePlatform.OSXPlayer || Application.platform == RuntimePlatform.LinuxPlayer || Application.platform == RuntimePlatform.WindowsEditor || Application.platform == RuntimePlatform.OSXEditor || Application.platform == RuntimePlatform.LinuxEditor)
|
|
|
|
|
{
|
|
|
|
|
VideoButton.SetActive(true);
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-04-12 21:22:45 +02:00
|
|
|
|
|
|
|
|
public void CreditsMenu(){
|
|
|
|
|
MainMenuObj.SetActive(false);
|
|
|
|
|
CreditsMenuObj.SetActive(true);
|
|
|
|
|
}
|
2022-11-16 11:23:25 +01:00
|
|
|
}
|