Beispiel #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("Start"))
        {
            // replace with your app ID!!!
            VungleBinding.startWithAppId("vungleTest");
        }


        if (GUILayout.Button("Start with Custom User Data"))
        {
            var userData = new Dictionary <string, object>();
            userData["gender"]          = 1;    // 0 unknown, 1 male, 2 female
            userData["adOrientation"]   = 1;    // 0 unknown, 1 portrait, 2 landscape
            userData["locationEnabled"] = true;
            userData["age"]             = 21;
            VungleBinding.startWithAppIdAndUserData("vungleTest", userData);
        }


        if (GUILayout.Button("Is Ad Available"))
        {
            Debug.Log("is ad available: " + VungleBinding.isAdAvailable());
        }


        if (GUILayout.Button("Play Modal Ad"))
        {
            VungleBinding.playModalAd(true);
        }


        endColumn(true);


        if (GUILayout.Button("Set Cache Size"))
        {
            VungleBinding.setCacheSize(12);
        }


        if (GUILayout.Button("Enable Logging"))
        {
            VungleBinding.enableLogging(true);
        }


        if (GUILayout.Button("Play Insentivised Ad"))
        {
            VungleBinding.playIncentivizedAd("user", true);
        }

        endColumn();
    }
Beispiel #3
0
    public static void showVungleAd()
    {
        if (SSAdInitializer.VungleActiveStaticFlag)
        {
            if (VungleBinding.isAdAvailable())
            {
                VungleBinding.playModalAd(true);
                adHasShownFlag       = true;
                activateInterstitial = false;
                failCounter          = 0;

                showingGameOver = false;
                showingOnLoad   = false;
                showingPause    = false;
                showingReturn   = false;
            }
            else
            {
                failedInterstitial = true;
                failCounter++;
            }
        }
    }