Esempio n. 1
0
    public bool IsCached(AdNetwork network, DisplayedAdType displayType, CBLocation location)
    {
        bool isCached = false;

#if ADFREE
        // Just return false if Ad-free
        return(false);
#endif

        switch (displayType)
        {
        case DisplayedAdType.FullScreen:

#if !MOREAPPSONLY
            switch (network)
            {
            case AdNetwork.ChartBoost:
            default:
                isCached = Chartboost.hasInterstitial(location);
                break;
            }
#endif

            break;

        case DisplayedAdType.MoreGames:
            switch (network)
            {
            case AdNetwork.ChartBoost:
            default:
                isCached = Chartboost.hasMoreApps(location);
                break;
            }
            break;

        case DisplayedAdType.Video:
            switch (network)
            {
            case AdNetwork.ChartBoost:
            default:
                isCached = Chartboost.hasRewardedVideo(location);
                break;
            }
            break;
        }

        if (Debug.isDebugBuild)
        {
            Debug.Log("Ad is cached: " + isCached.ToString());
        }

        return(isCached);
    }
Esempio n. 2
0
    public void CacheAd(AdNetwork network, DisplayedAdType displayType, CBLocation location)
    {
        #if ADFREE
        // Don't cache if Ad-free
        return;

        #endif

        if (Debug.isDebugBuild)
        {
            Debug.Log("Caching ad");
        }

        switch (displayType)
        {
            case DisplayedAdType.FullScreen:

        #if !MOREAPPSONLY

                switch (network)
                {
                    case AdNetwork.ChartBoost:
                    default:
                        Chartboost.cacheInterstitial(location);
                        break;
                }

        #endif

                break;

            case DisplayedAdType.MoreGames:
                switch (network)
                {
                    case AdNetwork.ChartBoost:
                    default:
                        Chartboost.cacheMoreApps(location);
                        break;
                }
                break;

            case DisplayedAdType.Video:
                switch (network)
                {
                    case AdNetwork.ChartBoost:
                    default:
                        Chartboost.cacheRewardedVideo(location);
                        break;
                }
                break;
        }
    }
Esempio n. 3
0
    public void CacheAd(AdNetwork network, DisplayedAdType displayType, CBLocation location)
    {
#if ADFREE
        // Don't cache if Ad-free
        return;
#endif

        if (Debug.isDebugBuild)
        {
            Debug.Log("Caching ad");
        }

        switch (displayType)
        {
        case DisplayedAdType.FullScreen:

#if !MOREAPPSONLY
            switch (network)
            {
            case AdNetwork.ChartBoost:
            default:
                Chartboost.cacheInterstitial(location);
                break;
            }
#endif

            break;

        case DisplayedAdType.MoreGames:
            switch (network)
            {
            case AdNetwork.ChartBoost:
            default:
                Chartboost.cacheMoreApps(location);
                break;
            }
            break;

        case DisplayedAdType.Video:
            switch (network)
            {
            case AdNetwork.ChartBoost:
            default:
                Chartboost.cacheRewardedVideo(location);
                break;
            }
            break;
        }
    }
Esempio n. 4
0
    public void ShowAd(AdNetwork network, DisplayedAdType displayType, CBLocation location)
    {
        #if ADFREE

        // Don't show Ad if Ad-free
        return;

        #endif

        CurrentInterval++;

        if (CurrentInterval % this.AdDisplayInterval != 0 && displayType == DisplayedAdType.FullScreen)
        {
            if (Debug.isDebugBuild)
            {
                Debug.Log("Can't display Ad yet: " + CurrentInterval.ToString());
            }

            // Don't display until every interval
            return;
        }

        if (Debug.isDebugBuild)
        {
            Debug.Log("Showing Ad");
        }

        switch (displayType)
        {
            case DisplayedAdType.FullScreen:

        #if !MOREAPPSONLY

                switch (network)
                {
                    case AdNetwork.ChartBoost:
                    default:
                        Chartboost.showInterstitial(location);
                        break;
                }

        #endif

                break;

            case DisplayedAdType.MoreGames:
                switch (network)
                {
                    case AdNetwork.ChartBoost:
                    default:
                        Chartboost.showMoreApps(location);
                        break;
                }
                break;

            case DisplayedAdType.Video:
                switch (network)
                {
                    case AdNetwork.ChartBoost:
                    default:
                        Chartboost.showRewardedVideo(location);
                        break;
                }
                break;
        }
    }
Esempio n. 5
0
    public bool IsCached(AdNetwork network, DisplayedAdType displayType, CBLocation location)
    {
        bool isCached = false;

        #if ADFREE

        // Just return false if Ad-free
        return false;

        #endif

        switch (displayType)
        {
            case DisplayedAdType.FullScreen:

        #if !MOREAPPSONLY

                switch (network)
                {
                    case AdNetwork.ChartBoost:
                    default:
                        isCached = Chartboost.hasInterstitial(location);
                        break;
                }

        #endif

                break;

            case DisplayedAdType.MoreGames:
                switch (network)
                {
                    case AdNetwork.ChartBoost:
                    default:
                        isCached = Chartboost.hasMoreApps(location);
                        break;
                }
                break;

            case DisplayedAdType.Video:
                switch (network)
                {
                    case AdNetwork.ChartBoost:
                    default:
                        isCached = Chartboost.hasRewardedVideo(location);
                        break;
                }
                break;
        }

        if (Debug.isDebugBuild)
        {
            Debug.Log("Ad is cached: " + isCached.ToString());
        }

        return isCached;
    }
Esempio n. 6
0
    public void ShowAd(AdNetwork network, DisplayedAdType displayType, CBLocation location)
    {
#if ADFREE
        // Don't show Ad if Ad-free
        return;
#endif

        CurrentInterval++;

        if (CurrentInterval % this.AdDisplayInterval != 0 && displayType == DisplayedAdType.FullScreen)
        {
            if (Debug.isDebugBuild)
            {
                Debug.Log("Can't display Ad yet: " + CurrentInterval.ToString());
            }

            // Don't display until every interval
            return;
        }

        if (Debug.isDebugBuild)
        {
            Debug.Log("Showing Ad");
        }

        switch (displayType)
        {
        case DisplayedAdType.FullScreen:

#if !MOREAPPSONLY
            switch (network)
            {
            case AdNetwork.ChartBoost:
            default:
                Chartboost.showInterstitial(location);
                break;
            }
#endif

            break;

        case DisplayedAdType.MoreGames:
            switch (network)
            {
            case AdNetwork.ChartBoost:
            default:
                Chartboost.showMoreApps(location);
                break;
            }
            break;

        case DisplayedAdType.Video:
            switch (network)
            {
            case AdNetwork.ChartBoost:
            default:
                Chartboost.showRewardedVideo(location);
                break;
            }
            break;
        }
    }