示例#1
0
        public TapSenseAdView(string adUnitId, BannerPosition position, AdSize adSize)
        {
            if (!_safeSetup())
            {
                id = 0;
                return;
            }
            id       = _initAdView(adUnitId, (int)position, adSize.width, adSize.height);
            listener = null;

            registerForCallbacks();
            TapSense.log("new AdView(): " + id + " registered");
        }
示例#2
0
        public TapSenseInterstitial(string adUnitId, bool autoRequestAd)
        {
            if (!_safeSetup())
            {
                id = 0;
                return;
            }
            id       = _initInterstitialWithAdUnitIdShouldAutoRequestAd(adUnitId, autoRequestAd);
            listener = null;

            registerForCallbacks();
            TapSense.log("new Interstitial(): " + id + " registered");
        }
示例#3
0
        public TapSenseInterstitial(string adUnitId, TSKeywordMap map)
        {
            if (!_safeSetup())
            {
                id = 0;
                return;
            }
            int mapIndex = (map != null) ? map.getId() : -1;

            id       = _initInterstitialWithAdUnitIdKeywordMap(adUnitId, mapIndex);
            listener = null;

            registerForCallbacks();
            TapSense.log("new Interstitial(): " + id + " registered");
        }
示例#4
0
    void Start()
    {
        UpdateAudio();

        switch (Application.platform)
        {
        case RuntimePlatform.OSXWebPlayer:
        case RuntimePlatform.WindowsWebPlayer:
        case RuntimePlatform.NaCl:
            fullScreenAvailable = true;
            quitEnabled         = false;
            directKeyQuit       = false;
            break;

        case RuntimePlatform.FlashPlayer:
            fullScreenAvailable = false;
            quitEnabled         = false;
            directKeyQuit       = false;
            break;

        case RuntimePlatform.OSXPlayer:
        case RuntimePlatform.WindowsPlayer:
            fullScreenAvailable = true;
            directKeyQuit       = false;
            break;
        }

        #if UNITY_ANDROID || UNITY_IPHONE
        if (mInterstitial == null || mBanner == null)
        {
            TapSense.setTestMode();
            TapSense.setShowDebugLog();

            mInterstitial = new TapSense.TapSenseInterstitial(INTERSTITIAL_AD_UNIT_ID);
            mInterstitial.setListener(this);
            mInterstitial.setVideoListener(this);

            mBanner = new TapSense.TapSenseAdView(BANNER_AD_UNIT_ID,
                                                  TapSense.BannerPosition.TOP,
                                                  TapSense.AdSize.Banner);
            mBanner.setListener(this);
            mBanner.loadAd();
        }
        mBanner.setVisibility(false);
        #endif
    }