Exemple #1
0
    // Displays an advert
    public static void displayAdvert(bool showCloseButtonOnIOS)
    {
#if UNITY_IPHONE
        VungleBinding.playModalAd(showCloseButtonOnIOS);
#elif UNITY_ANDROID
        VungleAndroid.displayAdvert();
#endif
    }
    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();
    }