You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

52 lines
1000 B

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem.HID;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class MainMenu : MonoBehaviour
{
public GameObject menu;
public GameObject credits;
public Button menuBtn;
public Button creditsBtn;
// Start is called before the first frame update
void Start()
{
menu.SetActive(true);
credits.SetActive(false);
}
public void SwapCanvas()
{
menu.SetActive(!menu.activeSelf);
credits.SetActive(!credits.activeSelf);
SwapButtons(menu.activeSelf);
}
public void SwapButtons(bool isActive)
{
if (isActive)
{
menuBtn.Select();
}
else
{
creditsBtn.Select();
}
}
public void StartGame()
{
SceneManager.LoadScene(1);
}
// Update is called once per frame
void Update()
{
}
}