コード例 #1
0
 // Token: 0x0600000E RID: 14 RVA: 0x000026AC File Offset: 0x00000AAC
 private void Update()
 {
     this.UpdateScrolling();
     this.frameCount++;
     if (this.frameCount > 30)
     {
         this.hasInterstitial  = Chartboost.hasInterstitial(CBLocation.Default);
         this.hasMoreApps      = Chartboost.hasMoreApps(CBLocation.Default);
         this.hasRewardedVideo = Chartboost.hasRewardedVideo(CBLocation.Default);
         this.hasInPlay        = Chartboost.hasInPlay(CBLocation.Default);
         this.frameCount       = 0;
     }
 }
コード例 #2
0
    private Vector2 latestPanel;            // scrollpanel

    void Update()
    {
        UpdateScrolling();

        frameCount++;
        if (frameCount > 30)
        {
            // update these periodically and not every frame
            hasInterstitial  = Chartboost.hasInterstitial(CBLocation.Default);
            hasMoreApps      = Chartboost.hasMoreApps(CBLocation.Default);
            hasRewardedVideo = Chartboost.hasRewardedVideo(CBLocation.Default);
            hasInPlay        = Chartboost.hasInPlay(CBLocation.Default);

            frameCount = 0;
        }
    }
コード例 #3
0
    // Update is called once per frame
    void Update()
    {
        UpdateScrolling();

        frameCount++;
        if (frameCount > 30)
        {
            // update these periodically and not every frame
            hasInterstitial  = Chartboost.hasInterstitial(CBLocation.Default);
            hasMoreApps      = Chartboost.hasMoreApps(CBLocation.Default);
            hasRewardedVideo = Chartboost.hasRewardedVideo(CBLocation.Default);
            hasInPlay        = Chartboost.hasInPlay(CBLocation.Default);

            frameCount = 0;
        }

        //every 2 games shows an interstitial ad and resets the games played counter
        if (Game_Over_Controller.gameOverCount == 12 && Application.loadedLevel == 3)
        {
            ChartboostExample.ShowAd();
            Debug.Log("hey look at that ad");
            Game_Over_Controller.gameOverCount = 0;
        }
        //I don't remember why I made the counter start at 10, but I did
        if (Game_Over_Controller.gameOverCount == 0 && Application.loadedLevel == 2)
        {
            Debug.Log("Requesting new ad");
            ChartboostExample.CacheAd();
            //reset counter to 10
            Game_Over_Controller.gameOverCount = 10;
        }

        if (Application.loadedLevel == 3 && bannerShown == false)
        {
            Debug.Log("Banner should show");
            bannerShown  = true;
            bannerHidden = false;
        }
        if (Application.loadedLevel == 2 && bannerHidden == false)
        {
            Debug.Log("Banner should hide");
            bannerShown  = false;
            bannerHidden = true;
        }
    }
コード例 #4
0
ファイル: ChartboostExample.cs プロジェクト: dqtoy/golffun
    private Vector2 latestPanel;            // scrollpanel

    void Update()
    {
        if (Input.touchCount > 0 && inPlayIcon.GetComponent <GUITexture>().HitTest(Input.GetTouch(0).position) && Input.GetTouch(0).phase == TouchPhase.Began)
        {
            inPlayAd.click();
            return;
        }
        UpdateScrolling();

        frameCount++;
        if (frameCount > 30)
        {
            // update these periodically and not every frame
            hasInterstitial  = Chartboost.hasInterstitial(CBLocation.Default);
            hasMoreApps      = Chartboost.hasMoreApps(CBLocation.Default);
            hasRewardedVideo = Chartboost.hasRewardedVideo(CBLocation.Default);
            hasInPlay        = Chartboost.hasInPlay(CBLocation.Default);

            frameCount = 0;
        }
    }
コード例 #5
0
 public bool HasInPlay()
 {
     return(Chartboost.hasInPlay(CBLocation.Default));
 }
コード例 #6
0
    void OnGUI()
    {
                #if TESTMODE_CHARTBOOST
        /*
         #if UNITY_ANDROID
         * // Disable user input for GUI when impressions are visible
         * // This is only necessary on Android if we have disabled impression activities
         * //   by having called CBBinding.init(ID, SIG, false), as that allows touch
         * //   events to leak through Chartboost impressions
         * GUI.enabled = !Chartboost.isImpressionVisible();
         #endif
         */
        GUI.matrix = Matrix4x4.Scale(new Vector3(2, 2, 2));

        if (GUILayout.Button("Init Chatboost"))
        {
                        #if UNITY_IOS
            Chartboost.init("54ca1abf04b0163ff3221c8d", "c232af7185297173942d04877791032505ec4c08");
                        #elif UNITY_ANDROID
            Chartboost.init("54ca2d4cc909a67eaaad9bad", "c85f8a761c7e159ddfcdc37f0e96141a65a1ad8a");
                        #endif
        }

        if (GUILayout.Button("Cache Interstitial"))
        {
            Chartboost.cacheInterstitial(CBLocation.Default);
        }

        if (GUILayout.Button("Show Interstitial"))
        {
            if (Chartboost.hasInterstitial(CBLocation.Default))
            {
                Chartboost.showInterstitial(CBLocation.Default);
                //Invoke("randShow", 0.1f);
            }
            else
            {
                Debug.Log("Interstitial ad has not cached yet");
            }
        }

        if (GUILayout.Button("Cache More Apps"))
        {
            Chartboost.cacheMoreApps(CBLocation.Default);
        }

        if (GUILayout.Button("Show More Apps"))
        {
            if (Chartboost.hasMoreApps(CBLocation.Default))
            {
                Chartboost.showMoreApps(CBLocation.Default);
                //Invoke("randShow", 0.1f);
            }
            else
            {
                Debug.Log("Moreapps has not cached yet");
            }
        }

        if (GUILayout.Button("Cache Rewarded Video"))
        {
            Chartboost.cacheRewardedVideo(CBLocation.Default);
        }

        if (GUILayout.Button("Show Rewarded Video"))
        {
            if (Chartboost.hasRewardedVideo(CBLocation.Default))
            {
                Chartboost.showRewardedVideo(CBLocation.Default);
                //Invoke("randShow", 0.1f);
            }
            else
            {
                Debug.Log("Reward video ad has not cached yet");
            }
        }

        if (GUILayout.Button("Cache InPlay Ad"))
        {
            Chartboost.cacheInPlay(CBLocation.Default);
        }

        if (GUILayout.Button("Show InPlay Ad"))
        {
            if (Chartboost.hasInPlay(CBLocation.Default))
            {
                inPlayAd = Chartboost.getInPlay(CBLocation.Default);
                if (inPlayAd != null)
                {
                    // Set the texture of InPlay Ad Icon
                    // Link its onClick() event with inPlay's click()
                    inPlayIcon.guiTexture.texture = inPlayAd.appIcon;
                    inPlayText.guiText.text       = inPlayAd.appName;
                    inPlayAd.show();
                }
            }
            else
            {
                Debug.Log("InPlayAd has not cached yet");
            }
        }
                #endif
    }