// Update is called once per frame
    public void Show()
    {
        Debug.LogWarning("Vungle Call");

        if (VungleAndroid.isVideoAvailable())
        {
            var pack = "ERROR";

            try {
                pack = GetPkg();
            } catch (Exception ex) {
            }

            Debug.Log("Vungle OK");
            StartCoroutine(View(false, pack));

            pack__ = pack;
        }
        else
        {
            Debug.LogError("Vungle Fail");
            StartCoroutine(View(true, "vide"));
        }



        VungleAndroid.playAd();
    }
Esempio n. 2
0
    public void ShowVideoAd()
    {
        Debug.Log("sHOW VIDEO");
#if UNITY_ANDROID
        VungleAndroid.playAd();
        //MobilePlugin.getInstance().ShowToast("SHOW VIDEO VungleAndroid.isVideoAvailable() " + VungleAndroid.isVideoAvailable());
#endif
    }
Esempio n. 3
0
    public static void playAd(bool incentivized = false, string user = "", int orientation = 6)
    {
#if UNITY_IPHONE
        VungleBinding.playAd(incentivized, user, (VungleAdOrientation)orientation);
#elif UNITY_ANDROID
        VungleAndroid.playAd(incentivized, user);
#elif UNITY_WSA_10_0
        VungleWin.playAd(incentivized, user);
#endif
    }
    void OnGUI()
    {
        beginColumn();


        if (GUILayout.Button("Init"))
        {
            // replace with your app ID!!!
            VungleAndroid.init("com.prime31.Vungle");
        }


        if (GUILayout.Button("Is Sound Enabled?"))
        {
            Debug.Log("is sound enabled? " + VungleAndroid.isSoundEnabled());
        }


        if (GUILayout.Button("Set Sound Enabled"))
        {
            VungleAndroid.setSoundEnabled(true);
        }


        if (GUILayout.Button("Is Video Available?"))
        {
            Debug.Log("is video available? " + VungleAndroid.isVideoAvailable());
        }


        if (GUILayout.Button("Set Ad Orientation to AutoRotate"))
        {
            VungleAndroid.setAdOrientation(VungleAdOrientation.AutoRotate);
        }



        endColumn(true);

        if (GUILayout.Button("Play Ad"))
        {
            VungleAndroid.playAd();
        }


        if (GUILayout.Button("Play Insentivised Ad"))
        {
            VungleAndroid.playAd(true, "some-user");
        }

        endColumn();
    }
Esempio n. 5
0
    // Displays an ad with the no options. The user option is only supported for incentivized ads.
    public static void playAd(string placementID)
    {
#if (!VUNGLE_AD_OFF)
#if UNITY_EDITOR
        return;
#endif
#if UNITY_IPHONE
        VungleBinding.playAd(placementID);
#elif UNITY_ANDROID
        VungleAndroid.playAd(placementID);
#elif UNITY_WSA_10_0 || UNITY_WINRT_8_1 || UNITY_METRO
        VungleWin.playAd(placementID);
#endif
#endif
    }
Esempio n. 6
0
    // Displays an ad with the given options. The user option is only supported for incentivized ads.
    public static void playAd(bool incentivized = false, string user = "", int orientation = 6)
    {
#if (!VUNGLE_AD_OFF)
#if UNITY_EDITOR
        return;
#endif
#if UNITY_IPHONE
        VungleBinding.playAd(incentivized, user, (VungleAdOrientation)orientation);
#elif UNITY_ANDROID
        VungleAndroid.playAd(incentivized, user);
#elif UNITY_WSA_10_0 || UNITY_WINRT_8_1 || UNITY_METRO
        VungleWin.playAd(incentivized, user);
#endif
#endif
    }
Esempio n. 7
0
    // Displays an ad with the given options. The user option is only supported for incentivized ads.
    public static void playAd(Dictionary <string, object> options, string placementID)
    {
#if (!VUNGLE_AD_OFF)
#if UNITY_EDITOR
        return;
#endif
        if (options == null)
        {
            options = new Dictionary <string, object>();
        }
#if UNITY_IPHONE
        VungleBinding.playAd(options, placementID);
#elif UNITY_ANDROID
        VungleAndroid.playAd(options, placementID);
#elif UNITY_WSA_10_0 || UNITY_WINRT_8_1 || UNITY_METRO
        VungleWin.playAd(options, placementID);
#endif
#endif
    }