Hello everyone.!
Im having a little issue whit my game, my ad function is working good when i have internet conection but i want it to show an error mesage when there is an error like not internet conection, in the unity program it works well, but when i make a test on android device it just doesnt i leave my code below.
Here is the script that manage my adds.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Advertisements;
using UnityEngine.SceneManagement;
public class Adds : MonoBehaviour {
public bool activar = true;
public void Start()
{
}
public void ShowAdd()
{
if(Advertisement.IsReady())
{
Advertisement.Show("rewardedVideo", new ShowOptions() { resultCallback = HandleResult});
}
}
public void HandleResult(ShowResult result)
{
switch(result)
{
case ShowResult.Finished:
if(GlobalObjectPro.Instance.vidas < 3)
{
GlobalObjectPro.Instance.vidas++;
SceneManager.LoadScene("MapaPrincipal");
}
break;
case ShowResult.Skipped:
break;
case ShowResult.Failed:
activar = true;
PauseMenu.Instance.activarCuadroConexion(activar);
break;
}
}
}
And this is the code that should be activated when the resultFailed, is just to set active an image.
public void activarCuadroConexion(bool activar)
{
cuadrConexion = activar;
}
thanks every1 i hope some1 knows whats happening ![]()