I can’t seem to enable a Canvas what so ever. I watched a video(more than 10 times) and followed everything EXACTLY. And I ended up with this script. The Canvas.enable = false; and Canvas.enable = true; does not seem to be functioning.
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class PauseMenu : MonoBehaviour
{
public Canvas pausemenu;
public Button pause;
public Button restart;
public Button cont;
public Button quit;
public Button mainMenu;
void Start()
{
pausemenu = pausemenu.GetComponent<Canvas> ();
pause = pause.GetComponent<Button>();
restart = restart.GetComponent<Button> ();
cont = cont.GetComponent<Button> ();
quit = quit.GetComponent<Button> ();
mainMenu = mainMenu.GetComponent<Button> ();
pausemenu.enabled = false;
}
public void PauseGame()
{
pausemenu.enabled = true;
}
}