Beispiel #1
0
    void OnGUI()
    {
        int buttonHeight = Screen.height / 13;
        int buttonWidth  = Screen.width / 2;
        int buttonSpace  = buttonHeight / 2;
        int startHeight  = buttonHeight / 2;

        if (GUI.Button(new Rect(Screen.width / 4, startHeight, buttonWidth, buttonHeight), "Show Banner Ad"))
        {
            if (Yodo1U3dMas.IsBannerAdLoaded())
            {
                int align = Yodo1U3dBannerAlign.BannerTop | Yodo1U3dBannerAlign.BannerHorizontalCenter;
                Yodo1U3dMas.ShowBannerAd(align);
            }
            else
            {
                Debug.Log("[Yodo1 Mas] Banner ad has not been cached.");
            }
        }

        if (GUI.Button(new Rect(Screen.width / 4, startHeight + buttonHeight + buttonSpace, buttonWidth, buttonHeight), "Dismiss Banner Ad"))
        {
            Yodo1U3dMas.DismissBannerAd();
        }

        if (GUI.Button(new Rect(Screen.width / 4, startHeight + buttonHeight * 2 + buttonSpace * 2, buttonWidth, buttonHeight), "Show Interstitial Ad"))
        {
            if (Yodo1U3dMas.IsInterstitialAdLoaded())
            {
                Yodo1U3dMas.ShowInterstitialAd();
            }
            else
            {
                Debug.Log("[Yodo1 Mas] Interstitial ad has not been cached.");
            }
        }

        if (GUI.Button(new Rect(Screen.width / 4, startHeight + buttonHeight * 3 + buttonSpace * 3, buttonWidth, buttonHeight), "Show Rewarded Ad"))
        {
            if (Yodo1U3dMas.IsRewardedAdLoaded())
            {
                Yodo1U3dMas.ShowRewardedAd();
            }
            else
            {
                Debug.Log("[Yodo1 Mas] Reward video ad has not been cached.");
            }
        }
    }
Beispiel #2
0
    IEnumerator BannerCoroutine()
    {
        yield return(new WaitForSeconds(2.0f));

        if (isBannerShown == false)
        {
            if (Yodo1U3dMas.IsBannerAdLoaded())
            {
                Yodo1U3dMas.ShowBannerAd();
            }
            else
            {
                StartCoroutine(BannerCoroutine());
            }
        }
    }