When I drag the QuizManager object into the button On Click i do not get the OnReplayLevel() method in the dropdown menu. Here is the screenshot from the button properties:
And here is my GameManager.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class GameManager : MonoBehaviour
{
[SerializeField] Quiz quiz;
[SerializeField] EndScreen endScreen;
void Start()
{
quiz.gameObject.SetActive(true);
endScreen.gameObject.SetActive(false);
}
void Update()
{
if (quiz.isComplete)
{
quiz.gameObject.SetActive(false);
endScreen.gameObject.SetActive(true);
endScreen.ShowFinalScore();
}
}
public void OnReplayLevel()
{
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
}
}