예제 #1
0
    public static IEnumerator AdRoutine()
    {
        // Disable game input
        ButtonController.showingAd = true;
        // Dim the game
        iTween.CameraFadeAdd();
        iTween.CameraFadeTo(1f, 1f);
        // wait a while
        yield return(new WaitForSeconds(1f));

        // Show the ad
        HZInterstitialAd.show();
        // wait a while
        yield return(new WaitForSeconds(3f));

        // Hide the ad
        HZInterstitialAd.hide();
        // Undim the game
        iTween.CameraFadeTo(0f, .5f);
        yield return(new WaitForSeconds(.5f));

        iTween.CameraFadeDestroy();
        // Enable input
        ButtonController.showingAd = false;
    }