Beispiel #1
0
 public void show()
 {
             #if UNITY_IPHONE
     TappxSettings.POSITION_BANNER positionBanner = TappxSettings.Instance.positionSceneIndex[sceneIndexLoaded];
     showAdIOS_(positionBanner == TappxSettings.POSITION_BANNER.TOP ? Position.TOP : Position.BOTTOM);
             #elif UNITY_ANDROID
     bool posit = true;
     TappxSettings.POSITION_BANNER positionBanner = TappxSettings.Instance.positionSceneIndex[sceneIndexLoaded];
     if (positionBanner == TappxSettings.POSITION_BANNER.BOTTOM)
     {
         posit = false;
     }
     bannerControl = new AndroidJavaObject("com.tappx.unity.bannerTappx", TappxSettings.getAndroidAppId(), posit, "TappxManagerUnity");
             #endif
 }
Beispiel #2
0
    public void show(TappxSettings.POSITION_BANNER pos, bool mrec)
    {
#if UNITY_IPHONE
        TappxSettings.POSITION_BANNER positionBanner = TappxSettings.Instance.positionSceneIndex[sceneIndexLoaded];
        showAdIOS_(positionBanner == pos ? Position.TOP : Position.BOTTOM);
#elif UNITY_ANDROID
        if (bannerControl != null)
        {
            bannerControl.Call("hideBannerGONE");
            bannerControl = null;
        }

        bool posit = true;
        if (pos == TappxSettings.POSITION_BANNER.BOTTOM)
        {
            posit = false;
        }
        bannerControl = new AndroidJavaObject("com.tappx.unity.bannerTappx", TappxSettings.getAndroidAppId(), mrec, posit, TappxSettings.Instance.testEnabled,
                                              "TappxManagerUnity");
#endif
    }
Beispiel #3
0
    void OnLevelWasLoaded(int level)
#endif

    {
#if UNITY_ANDROID
        if (bannerControl != null)
        {
            bannerControl.Call("hideBannerGONE");
            bannerControl = null;
        }
#endif

#if UNITY_5_4_OR_NEWER
        sceneIndexLoaded = scene.buildIndex;
#else
        sceneIndexLoaded = level;
#endif

        if (Application.isEditor)
        {
            return;
        }

#if UNITY_IPHONE
        hide();

        trackInstallIOS_(TappxSettings.getIOSAppId(), TappxSettings.Instance.testEnabled);

        if (TappxSettings.Instance.sceneIndex[sceneIndexLoaded] == true && TappxSettings.Instance.sceneListEnabled)
        {
            bool Banner               = TappxSettings.Instance.bannerSceneIndex[sceneIndexLoaded];
            bool mrec                 = TappxSettings.Instance.mrecSceneIndex[sceneIndexLoaded];
            bool Interstitial         = TappxSettings.Instance.interstitialSceneIndex[sceneIndexLoaded];
            bool AutoShowInterstitial = TappxSettings.Instance.interstitialAutoShow[sceneIndexLoaded];

            if (Banner ^ Interstitial)
            {
                if (Banner)
                {
                    TappxSettings.POSITION_BANNER posBanner = TappxSettings.Instance.positionSceneIndex[sceneIndexLoaded];
                    createBannerIOS_((posBanner == TappxSettings.POSITION_BANNER.TOP) ? Position.TOP : Position.BOTTOM, mrec);
                }
                else
                {
                    loadInterstitialIOS_(AutoShowInterstitial);
                }
            }
        }
#elif UNITY_ANDROID
        if (TappxSettings.Instance.sceneIndex[sceneIndexLoaded] == true && TappxSettings.Instance.sceneListEnabled)
        {
            bool Banner               = TappxSettings.Instance.bannerSceneIndex[sceneIndexLoaded];
            bool mrec                 = TappxSettings.Instance.mrecSceneIndex[sceneIndexLoaded];
            bool Interstitial         = TappxSettings.Instance.interstitialSceneIndex[sceneIndexLoaded];
            bool AutoShowInterstitial = TappxSettings.Instance.interstitialAutoShow[sceneIndexLoaded];
            TappxSettings.POSITION_BANNER positionBanner = TappxSettings.Instance.positionSceneIndex[sceneIndexLoaded];


            if (Banner)
            {
                bool posit = true;
                if (positionBanner == TappxSettings.POSITION_BANNER.BOTTOM)
                {
                    posit = false;
                }
                bannerControl = new AndroidJavaObject("com.tappx.unity.bannerTappx", TappxSettings.getAndroidAppId(), mrec, posit, TappxSettings.Instance.testEnabled, "TappxManagerUnity");
            }

            if (Interstitial)
            {
                interstitialControl = new AndroidJavaObject("com.tappx.unity.interstitialTappx", TappxSettings.getAndroidAppId(), AutoShowInterstitial, TappxSettings.Instance.testEnabled, "TappxManagerUnity");
            }
        }
#endif
    }