Qu/Assets/Scripts/Menu.cs
Gerard Gascón bd5b1556ff init
2025-04-24 14:23:29 +02:00

35 lines
709 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Cinemachine;
public class Menu : MonoBehaviour{
public CinemachineVirtualCamera cam;
public GameObject canvas;
// Start is called before the first frame update
void Awake(){
Time.timeScale = 0;
}
// Update is called once per frame
void Update(){
}
public void Play(){
Time.timeScale = 1;
cam.gameObject.SetActive(false);
StartCoroutine(DisableCanvas());
}
public void Quit(){
Application.Quit();
}
IEnumerator DisableCanvas(){
yield return new WaitForSeconds(1f);
canvas.SetActive(false);
}
}