예제 #1
0
    public void ShowInterstitial()
    {
#if UNITY_IOS
        if (Application.platform == RuntimePlatform.IPhonePlayer)
        {
            DMUnityManager.DomobPresentInterstitialsAd(DOMOB_INTERSTITIAL);
        }
#else
        if (Application.platform == RuntimePlatform.Android)
        {
            jo.Call("showInterstitial");
        }
#endif
    }
예제 #2
0
    public void InitInterstitial()
    {
#if UNITY_IOS
        if (Application.platform == RuntimePlatform.IPhonePlayer)
        {
            DMUnityManager.DomobInterstitialsAdInitialize(PUBLISHER_ID, INSERT_PLACEMENT_ID, "DomobAD", DOMOB_INTERSTITIAL);
        }
#else
        if (Application.platform == RuntimePlatform.Android)
        {
            jo.Call("initInterstitial");
        }
#endif
    }
예제 #3
0
    public void ShowBanner()
    {
#if UNITY_IOS
        if (Application.platform == RuntimePlatform.IPhonePlayer)
        {
            DMUnityManager.DomobAddBannerADView(Screen.width / 4 - 160, Screen.height / 2 - 50, 320, 50, PUBLISHER_ID, BANNER_PLACEMENT_ID, "DomobAD", BANNER);
        }
#else
        if (Application.platform == RuntimePlatform.Android)
        {
            jo.Call("showBanner");
        }
#endif
    }
예제 #4
0
    public void HideBanner()
    {
#if UNITY_IOS
        if (Application.platform == RuntimePlatform.IPhonePlayer)
        {
            DMUnityManager.DomobRemoveBannerADView(BANNER);
        }
#else
        if (Application.platform == RuntimePlatform.Android)
        {
            jo.Call("hideBanner");
        }
#endif
    }
    void OnGUI()
    {
        float x       = 0.25f * Screen.width;
        float padding = 0.077f * Screen.height;
        float w       = 0.5f * Screen.width;
        float h       = 0.077f * Screen.height;

        GUI.Label(new Rect(x, padding * 11, w, h), labelString);

        if (GUI.Button(new Rect(x, padding, w, h), "Show BannerAd"))
        {
            labelString = "WAITING......";
            DMUnityManager.DomobAddBannerADView(0, 0, 320, 50, ONLINE_PUBLISHER_ID, ONLINE_PLACEMENT_ID, "Main Camera", BANNER);
        }

        if (GUI.Button(new Rect(x, padding * 3, w, h), "Remove BannerAd"))
        {
            labelString = "WAITING......";
            DMUnityManager.DomobRemoveBannerADView(BANNER);
        }

        if (GUI.Button(new Rect(x, padding * 5, w, h), "Request Interstitial Ad"))
        {
            labelString = "WAITING......";

            DMUnityManager.DomobInterstitialsAdInitialize(ONLINE_PUBLISHER_ID, ONLINE_PLACEMENT_ID, "Main Camera", DOMOB_INTERSTITIAL);
        }

        if (GUI.Button(new Rect(x, padding * 7, w, h), "present Interstitial Ad"))
        {
            labelString = "WAITING......";

            DMUnityManager.DomobPresentInterstitialsAd(DOMOB_INTERSTITIAL);
        }

        if (GUI.Button(new Rect(x, padding * 9, w, h), "Remove nterstitial Ad"))
        {
            labelString = "WAITING......";
            DMUnityManager.DomobRemoveInterstitialsAd(DOMOB_INTERSTITIAL);
        }
    }