I have a little problem with my script.
If anybody can help me, it whould be appreciating!
OK.
So I get this NullReferenceExeption error, how can I fix this?
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class MenuSwitch : MonoBehaviour {
public Canvas canvas;
public Button button;
void Start()
{
button = GetComponent<Button>();
canvas.enabled = false;
}
public void Press()
{
button.enabled = true;
canvas.enabled = true;
}
}
I made this script for my Main Menu Panel switching