Hi,
I’m having a similar issue to Replay Button not working
But I’ve looked at the sorting order, and the WinCanvas is set to 100 and QuizCanvas is set to 1.
I tried to make a new button and change the highlighting color and also the onclick color which seemed to work, but as soon as I dragged the game manager onto it, it simply stopped working.
using UnityEngine;
using UnityEngine.SceneManagement;
public class GameManager : MonoBehaviour
{
Quiz quiz;
EndScreen endScreen;
private void Awake()
{
quiz = FindObjectOfType<Quiz>();
endScreen = FindObjectOfType<EndScreen>();
}
private void Start()
{
quiz.gameObject.SetActive(true);
endScreen.gameObject.SetActive(false);
}
private void Update()
{
if(quiz.isComplete)
{
quiz.gameObject.SetActive(false);
endScreen.gameObject.SetActive(true);
endScreen.ShowFinalScore();
}
}
public void OnReplayLevel()
{
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
}
}