When the Continue Ads gameobject is closed, the Game over button works, but when the Continue Ads is turned on, the Game over button does not work. I cannot understand why I make a mistake?
!Me fixed the problem, the problem is that I noticed that it is related to the continue ads dimension, thank you for your time.
void Update()
{
if (Application.internetReachability == NetworkReachability.NotReachable)
{
//Debug.Log("No internet access");
Destroy(GameObject.FindWithTag("ContinuePanel"));
}
else
{
//Debug.Log("internet connection");
if (tag == "Skull")
{
ContinueAds();
}
}
}
public void ContinueAds()
{
gameObject.AddComponent<AdsScript1>();
gameoverPanel.SetActive(false);
PausedGamePanel();
}
public void GameoverButton()
{
gameoverPanel.SetActive(false);
SceneManager.LoadScene(0);
}
Your continue ads object is in gameover panel. When you set gameoverPanel.SetActive(false) you also do the same on the child objects.