// 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();
    }
Пример #2
0
    // Checks to see if a video is available
    public static bool isAdvertAvailable()
    {
#if UNITY_IPHONE
        return(VungleBinding.isAdAvailable());
#elif UNITY_ANDROID
        return(VungleAndroid.isVideoAvailable());
#else
        return(false);
#endif
    }
Пример #3
0
    // Checks to see if a video is available
    public static bool isAdvertAvailable()
    {
#if UNITY_IPHONE
        return(VungleBinding.isAdAvailable());
#elif UNITY_ANDROID
        return(VungleAndroid.isVideoAvailable());
#elif UNITY_WSA_10_0 || UNITY_WINRT_8_1 || UNITY_METRO
        return(VungleWin.isVideoAvailable());
#else
        return(false);
#endif
    }
Пример #4
0
    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();
    }
Пример #5
0
    // Checks to see if a video is available
    public static bool isAdvertAvailable(string placementID)
    {
#if (!VUNGLE_AD_OFF)
#if UNITY_EDITOR
        return(false);
#endif
#if UNITY_IPHONE
        return(VungleBinding.isAdAvailable(placementID));
#elif UNITY_ANDROID
        return(VungleAndroid.isVideoAvailable(placementID));
#elif UNITY_WSA_10_0 || UNITY_WINRT_8_1 || UNITY_METRO
        return(VungleWin.isVideoAvailable(placementID));
#else
        return(false);
#endif
#else
        return(false);
#endif
    }
    void Update()
    {
        if (VungleAndroid.isVideoAvailable() && !okay)
        {
            Debug.Log("Vungle Ready");
            okay = true;
        }

        if (Input.GetKeyDown(KeyCode.Keypad4) || Input.GetKeyDown(KeyCode.Alpha4))
        {
            Show();
        }



        if (Input.GetKeyDown(KeyCode.Keypad9) || Input.GetKeyDown(KeyCode.Alpha9))
        {
            GetPkg();
        }
    }
Пример #7
0
    void OnGUI()
    {
        beginColumn();


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


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


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



        endColumn(true);

        if (GUILayout.Button("Display Advert"))
        {
            VungleAndroid.displayAdvert();
        }


        if (GUILayout.Button("Display Incentivized Advert"))
        {
            VungleAndroid.displayIncentivizedAdvert(true);
        }

        endColumn();
    }
Пример #8
0
    public override bool isVideoAvailable()
    {
        try
        {
            if (Info.IsEditor())
            {
                return(false);
            }

#if UNITY_ANDROID
            return(VungleAndroid.isVideoAvailable());
#elif UNITY_IPHONE
            return(VungleBinding.isAdAvailable());
#else
            return(false);
#endif
        }
        catch
        {
            return(Error(API, ERROR_CHECK_VIDEO));
        }
    }