Пример #1
0
    // Mostra o video
    public override bool showVideo(VideoDelegate methodToCall)
    {
        if (!isVideoAvailable())
        {
            return(false);
        }

        try
        {
            if (Info.IsEditor())
            {
                return(false);
            }

#if UNITY_ANDROID
            callback = methodToCall;
            VungleAndroid.displayIncentivizedAdvert(false);
            return(true);
#elif UNITY_IPHONE
            callback = methodToCall;
            VungleBinding.playIncentivizedAd("user", false);
            return(true);
#else
            return(false);
#endif
        }
        catch
        {
            return(Error(API, ERROR_PLAY_VIDEO));
        }
    }
Пример #2
0
    // Displays an incentivized advert with optional name
    public static void displayIncentivizedAdvert(bool showCloseButton, string user)
    {
#if UNITY_IPHONE
        VungleBinding.playIncentivizedAd(user, showCloseButton);
#elif UNITY_ANDROID
        VungleAndroid.displayIncentivizedAdvert(showCloseButton, user);
#endif
    }
Пример #3
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();
    }