Search Unity

ads offline

Discussion in 'Unity Ads & User Acquisition' started by kaiezer1980, Apr 13, 2018.

  1. kaiezer1980

    kaiezer1980

    Joined:
    Mar 26, 2018
    Posts:
    3
    hi everyone i'm new to the forum and i hope to find solution to my problem
    I started the development of a small VR application on the unit below all goes well but wanting to integrate an ads that is provided in service I made a scene that serves as a splash screen I also makes a little code that allows me to display ads switcher for another scene but also no problem but once I disconnect from the Internet The application remains stuck on the splash screen
    this is the code
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using UnityEngine.SceneManagement;
    4. using UnityEngine.Advertisements;
    5.  
    6. public class SimpleAds : MonoBehaviour
    7. {
    8.     void Start ()
    9.     {
    10.         Advertisement.Initialize ("33675", true);
    11.  
    12.         StartCoroutine (ShowAdWhenReady());
    13.     }
    14.  
    15.     IEnumerator ShowAdWhenReady()
    16.     {
    17.         while (!Advertisement.IsReady())
    18.             yield return null;
    19.  
    20.         Advertisement.Show ();
    21.  
    22.  
    23.         StartCoroutine("Wait");
    24.         }
    25.  
    26.         IEnumerator Wait()
    27.         {
    28.             yield return new WaitForSeconds(1);
    29.  
    30.         SceneManager.LoadScene(1);
    31.     }
    32.  
    33.  
    34. }
     
    Sonicjoy likes this.
  2. DiverseTheGameMakers

    DiverseTheGameMakers

    Joined:
    Feb 11, 2018
    Posts:
    4
    this is because unity ads is a server full of ads that need a network to work