public void HandlePlacementRequestSuccess(TJPlacement placement)
 {
     if (placement.IsContentAvailable ()) {
         Debug.Log ("C#: Content available for " + placement.GetName ());
     } else {
         Debug.Log ("C#: No content available for " + placement.GetName ());
     }
 }
 public void HandlePlacementContentReady(TJPlacement placement)
 {
     Debug.Log ("C#: HandlePlacementContentReady");
     if (placement.IsContentAvailable ()) {
         //placement.ShowContent();
     } else {
         Debug.Log ("C#: no content");
     }
 }
예제 #3
0
 public void HandlePlacementRequestSuccess(TJPlacement placement)
 {
     if (placement.IsContentAvailable())
     {
         placement.ShowContent();
     }
     else
     {
         MyLog.D("C#: No content available for " + placement.GetName());
     }
 }
예제 #4
0
 public void HandlePlacementContentReady(TJPlacement placement)
 {
     MyLog.D("C#: HandlePlacementContentReady");
     if (placement.IsContentAvailable())
     {
         placement.ShowContent();
     }
     else
     {
         MyLog.D("C#: no content");
     }
 }
예제 #5
0
 public void HandlePlacementContentReady(TJPlacement placement)
 {
     Debug.Log("C#: HandlePlacementContentReady");
     output = "HandlePlacementContentReady";
     if (placement.IsContentAvailable())
     {
         //placement.ShowContent();
     }
     else
     {
         Debug.Log("C#: no content");
     }
 }
 public void HandlePlacementContentReady(TJPlacement placement)
 {
     this.ShowMessage("Tapjoy.OnContentReadyHandler({0})", new object[]
     {
         placement
     });
     if (!placement.IsContentAvailable())
     {
         this.RemovePlacement(placement);
         return;
     }
     placement.ShowContent();
 }
예제 #7
0
 public void HandlePlacementContentReady(TJPlacement placement)
 {
     if (placement.GetName() == "Video")
     {
         if (placement.IsContentAvailable())
         {
             uiVideoLabel.text = "Видео(загружено)\n+200 руб";
         }
         else
         {
             uiVideoLabel.text = "Нет контента\n(видео)";
         }
         loadingSpriteUI.enabled = false;
     }
 }
예제 #8
0
 public void HandlePlacementRequestSuccess(TJPlacement placement)
 {
     if (placement.GetName() == "Video")
     {
         if (placement.IsContentAvailable())
         {
             uiVideoLabel.text = "Смотреть видео\n+200 руб";
         }
         else
         {
             uiVideoLabel.text = "Нет контента\n(видео)";
         }
         loadingSpriteUI.enabled = false;
     }
 }
예제 #9
0
 public void HandlePlacementRequestSuccess(TJPlacement placement)
 {
     if (placement.IsContentAvailable())
     {
         if (placement.GetName() == samplePlacementName)
         {
             Debug.Log("C#: Content available for " + placement.GetName());
             output = "Content available for " + placement.GetName();
             contentIsReadyForPlacement = true;
         }
         else if (placement.GetName() == "offerwall_unit")
         {
             // Show offerwall immediately
             placement.ShowContent();
         }
     }
     else
     {
         output = "No content available for " + placement.GetName();
         Debug.Log("C#: No content available for " + placement.GetName());
     }
 }
예제 #10
0
    void OnGUI()
    {
        Rect  position;
        float yPosition = startY;

        if (inputStyle == null)
        {
            inputStyle          = GUI.skin.textField;
            inputStyle.fontSize = fontSize;
        }

        position = new Rect(centerX - (buttonWidth / 2), yPosition, buttonWidth, buttonHeight);
        if (GUI.Button(position, "Show Offerwall"))
        {
            if (offerwallPlacement != null)
            {
                offerwallPlacement.RequestContent();
            }
        }

        yPosition += yPadding;

        position = new Rect(centerX - (buttonWidth / 2), yPosition, buttonWidth, buttonHeight);
        if (GUI.Button(position, "Show Direct Play Video Ad"))
        {
            if (directPlayPlacement.IsContentAvailable())
            {
                if (directPlayPlacement.IsContentReady())
                {
                    directPlayPlacement.ShowContent();
                }
                else
                {
                    output = "Direct play video not ready to show.";
                }
            }
            else
            {
                output = "No direct play video to show.";
            }
        }

        yPosition += yPadding;

        // Managed Currency Header
        position = new Rect(centerX - (buttonWidth / 2), yPosition, buttonWidth, headerHeight);
        GUI.Label(position, "Managed Currency:", headerStyle);

        yPosition += yPadding - (yPadding - headerHeight);

        position = new Rect(centerX - (thirdButtonWidth + (thirdButtonWidth / 2)), yPosition, thirdButtonWidth, buttonHeight);
        if (GUI.Button(position, "Get"))
        {
            ResetCurrencyLabel();
            Tapjoy.GetCurrencyBalance();
        }

        position = new Rect(centerX - (thirdButtonWidth / 2), yPosition, thirdButtonWidth, buttonHeight);
        if (GUI.Button(position, "Spend"))
        {
            ResetCurrencyLabel();
            Tapjoy.SpendCurrency(10);
        }

        position = new Rect(centerX + (thirdButtonWidth / 2), yPosition, thirdButtonWidth, buttonHeight);

        if (GUI.Button(position, "Award"))
        {
            ResetCurrencyLabel();
            Tapjoy.AwardCurrency(10);
        }

        yPosition += yPadding;

        // Managed Currency Header
        position = new Rect(centerX - (buttonWidth / 2), yPosition, buttonWidth, headerHeight);
        GUI.Label(position, "Content Placement:", headerStyle);

        yPosition += yPadding - (yPadding - headerHeight);

        position            = new Rect(centerX - (buttonWidth / 2), yPosition, buttonWidth, headerHeight);
        samplePlacementName = GUI.TextField(position, samplePlacementName, 30, inputStyle);

        yPosition += headerHeight + 10;

        position = new Rect(centerX - halfButtonWidth, yPosition, halfButtonWidth, buttonHeight);
        if (GUI.Button(position, "Request"))
        {
            // Create a new sample event
            samplePlacement = TJPlacement.CreatePlacement(samplePlacementName);
            if (samplePlacement != null)
            {
                samplePlacement.RequestContent();
                output = "Requesting content for placement: " + samplePlacementName;
            }
        }

        if (!contentIsReadyForPlacement)
        {
            GUI.enabled = false;
        }
        position = new Rect(centerX, yPosition, halfButtonWidth, buttonHeight);
        if (GUI.Button(position, "Show"))
        {
            samplePlacement.ShowContent();
        }
        if (!contentIsReadyForPlacement)
        {
            GUI.enabled = true;
        }

        yPosition += yPadding;

        // Purchase Header
        position = new Rect(centerX - (buttonWidth / 2), yPosition, buttonWidth, headerHeight);
        GUI.Label(position, "Purchase:", headerStyle);

        yPosition += yPadding - (yPadding - headerHeight);

        position = new Rect(centerX - (buttonWidth / 2), yPosition, buttonWidth, buttonHeight);
        if (GUI.Button(position, "Purchase"))
        {
            Tapjoy.TrackPurchase("product1", "USD", 0.99);
            output = "Sent track purchase";
        }
        yPosition += yPadding;

        position = new Rect(centerX - (buttonWidth / 2), yPosition, buttonWidth, buttonHeight);
        if (GUI.Button(position, "Purchase (Campaign)"))
        {
            Tapjoy.TrackPurchase("product1", "USD", 1.99, "TestCampaignID");
            output = "Sent track purchase 2";
        }
        yPosition += yPadding;

        position = new Rect(centerX - halfButtonWidth, yPosition, halfButtonWidth, buttonHeight);
        if (GUI.Button(position, "Purchase (GooglePlayStore)"))
        {
            Tapjoy.TrackPurchaseInGooglePlayStore(getDummySkuDetails(), getDummyPurchaseData(), getDummyDataSignature(), "TestCampaignID");
            output = "Sent TrackPurchaseInGooglePlayStore";
        }

        position = new Rect(centerX, yPosition, halfButtonWidth, buttonHeight);
        if (GUI.Button(position, "Purchase (AppleAppStore)"))
        {
            Tapjoy.TrackPurchaseInAppleAppStore("product1", "USD", 1.99, "transactionId", "TestCampaignID");
            output = "Sent TrackPurchaseInAppleAppStore";
        }
        yPosition += yPadding;

        // Display status
        GUI.Label(new Rect(centerX - 200, yPosition, 400, 150), output, outputStyle);
    }
    public void HandlePlacementRequestSuccess(TJPlacement placement)
    {
        if (placement.IsContentAvailable ()) {
            if (placement.GetName () == samplePlacementName) {
                Debug.Log ("C#: Content available for " + placement.GetName ());
                output = "Content available for " + placement.GetName ();
                contentIsReadyForPlacement = true;
            } else if (placement.GetName () == "offerwall_unit") {
                // Show offerwall immediately
                placement.ShowContent ();
            }

        } else {
            output = "No content available for " + placement.GetName ();
            Debug.Log ("C#: No content available for " + placement.GetName ());
        }
    }