Search Unity

Does Unity Ads not work in a Coroutine? [Solved]

Discussion in 'Unity Ads' started by ehsu, May 21, 2015.

  1. ehsu

    ehsu

    Joined:
    May 16, 2014
    Posts:
    2
    I want to display unity ads after a short delay at the End screen of the game i'm working on. So i decided to do a simple coroutine as below

    Code (CSharp):
    1. StartCoroutine ("WaitOneSec");
    2.  
    3. IEnumerator WaitOneSec(){
    4.         yield return new WaitForSeconds (1f);
    5.         advertisement.SendMessage ("ShowVideoAd");
    6.     }
    If i were to use advertisement.SendMessage ("ShowVideoAd"); on its own the advertisement would show, but when i try it with the StartCoroutine it does not.
     
  2. ehsu

    ehsu

    Joined:
    May 16, 2014
    Posts:
    2
    Nvm i'm an idiot. i have paused the game with Time.timeScale = 0 when the game ends. with the game paused the WaitForSeconds did not work.