void Update()
 {
     if (Input.touchCount > 0 && inPlayIcon.guiTexture.HitTest(Input.GetTouch(0).position) && Input.GetTouch(0).phase == TouchPhase.Began)
     {
         inPlayAd.click();
     }
 }
コード例 #2
0
 void Update()
 {
             #if TESTMODE_CHARTBOOST
     if (Input.touchCount > 0 && inPlayIcon.guiTexture.HitTest(Input.GetTouch(0).position) && Input.GetTouch(0).phase == TouchPhase.Began)
     {
         inPlayAd.click();
     }
             #endif
 }
コード例 #3
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;
        }
    }
コード例 #4
0
    void LayoutButtons()
    {
        // The view with buttons to trigger the main Chartboost API calls
        GUILayout.Space(5);
        GUILayout.Label("Has Interstitial: " + hasInterstitial);

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

        if (GUILayout.Button("Show Interstitial", GUILayout.Width(ELEMENT_WIDTH)))
        {
            Chartboost.showInterstitial(CBLocation.Default);
        }

        GUILayout.Space(5);
        GUILayout.Label("Has MoreApps: " + hasMoreApps);
        if (GUILayout.Button("Cache More Apps", GUILayout.Width(ELEMENT_WIDTH)))
        {
            Chartboost.cacheMoreApps(CBLocation.Default);
        }

        if (GUILayout.Button("Show More Apps", GUILayout.Width(ELEMENT_WIDTH)))
        {
            Chartboost.showMoreApps(CBLocation.Default);
        }

        GUILayout.Space(5);
        GUILayout.Label("Has Rewarded Video: " + hasRewardedVideo);
        if (GUILayout.Button("Cache Rewarded Video", GUILayout.Width(ELEMENT_WIDTH)))
        {
            Chartboost.cacheRewardedVideo(CBLocation.Default);
        }

        if (GUILayout.Button("Show Rewarded Video", GUILayout.Width(ELEMENT_WIDTH)))
        {
            Chartboost.showRewardedVideo(CBLocation.Default);
        }

        GUILayout.Space(5);
        GUILayout.Label("Has InPlay: " + hasInPlay);
        if (GUILayout.Button("Cache InPlay Ad", GUILayout.Width(ELEMENT_WIDTH)))
        {
            Chartboost.cacheInPlay(CBLocation.Default);
        }

        if (GUILayout.Button("Show InPlay Ad", GUILayout.Width(ELEMENT_WIDTH)))
        {
            inPlayAd = Chartboost.getInPlay(CBLocation.Default);
            if (inPlayAd != null)
            {
                inPlayAd.show();
            }
        }
        if (inPlayAd != null)
        {
            // Set the texture of InPlay Ad Icon
            // Link its onClick() event with inPlay's click()
            GUILayout.Label("app: " + inPlayAd.appName);
            if (GUILayout.Button(inPlayAd.appIcon, GUILayout.Width(ELEMENT_WIDTH)))
            {
                inPlayAd.click();
            }
        }

        GUILayout.Space(5);
        GUILayout.Label("Post install events:");
        if (GUILayout.Button("Send PIA Main Level Event", GUILayout.Width(ELEMENT_WIDTH)))
        {
            Chartboost.trackLevelInfo("Test Data", CBLevelType.HIGHEST_LEVEL_REACHED, 1, "Test Send mail level Information");
        }

        if (GUILayout.Button("Send PIA Sub Level Event", GUILayout.Width(ELEMENT_WIDTH)))
        {
            Chartboost.trackLevelInfo("Test Data", CBLevelType.HIGHEST_LEVEL_REACHED, 1, 2, "Test Send sub level Information");
        }

        if (GUILayout.Button("Track IAP", GUILayout.Width(ELEMENT_WIDTH)))
        {
            TrackIAP();
        }
    }