Ejemplo n.º 1
0
 public void HandlePlacementContentShow(TJPlacement placement)
 {
     if (placement.GetName() == "Video")
     {
         loadingSpriteUI.enabled = false;
     }
 }
Ejemplo n.º 2
0
    public void Show_Video()
    {
        if (!isInitted)
        {
            Debug.LogError("Tapjoy Not Initted");
            return;
        }

        if (BannerAd != null)
        {
            Debug.LogError("BannerAd not null");
            if (BannerAd.IsContentReady())
            {
                Debug.LogError("BannerAd show");
                BannerAd.ShowContent();
            }
            else
            {
                StartCoroutine(ShowVid());
            }
        }
        else
        {
            Debug.LogError("BannerAd null");
            BannerAd = TJPlacement.CreatePlacement("Ad_Video");
        }
    }
Ejemplo n.º 3
0
 public void TapjoyEvents()
 {
     if (Tapjoy.IsConnected)
     {
         // Create offerwall placement
         if (offerwallPlacement == null)
         {
             offerwallPlacement = TJPlacement.CreatePlacement("unitys");
         }
         if (offerwallPlacement.IsContentReady())
         {
             offerwallPlacement.ShowContent();
         }
         else
         {
             offerwallPlacement.RequestContent();
             offerwallPlacement.ShowContent();
             MyLog.W("Tapjoy offerwallPlacement.IsContentReady false");
             //Code to handle situation where content is not ready goes here
         }
     }
     else
     {
         Tapjoy.Connect(MyConfig.TAPJOY_KEY);
         MyLog.W("Tapjoy.IsConnected false");
     }
 }
Ejemplo n.º 4
0
        protected override void InternalLoadRewardedAd(AdPlacement placement)
        {
#if EM_TAPJOY
            if (placement == AdPlacement.Default) // Default rewarded ad...
            {
                LoadPlacement(mDefaultRewaredVideoPlacement);
            }
            else // Custom rewarded ad...
            {
                string id = FindIdForPlacement(mAdSettings.CustomRewardedAdIds, placement);

                if (string.IsNullOrEmpty(id))
                {
                    Debug.LogFormat("Attempting to load {0} rewarded ad with an undefined ID at placement {1}",
                                    Network.ToString(),
                                    AdPlacement.GetPrintableName(placement));
                    return;
                }

                if (!mCustomRewardedPlacements.ContainsKey(placement) || mCustomRewardedPlacements[placement] == null)
                {
                    mCustomRewardedPlacements[placement] = TJPlacement.CreatePlacement(id);
                }

                LoadPlacement(mCustomRewardedPlacements[placement]);
            }
#endif
        }
Ejemplo n.º 5
0
    public void Show_Inter()
    {
        if (!isInitted)
        {
            Debug.LogError(" Show_Inter Tapjoy Not Initted");
            return;
        }

        if (IntterAd != null)
        {
            Debug.LogError("IntterAd not null");
            if (IntterAd.IsContentReady())
            {
                Debug.LogError("IntterAd show");
                IntterAd.ShowContent();
            }
            else
            {
                StartCoroutine(ShowVid());
            }
        }
        else
        {
            Debug.LogError("IntterAd null");
            IntterAd = TJPlacement.CreatePlacement("InterSticial");
        }
    }
 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 ());
     }
 }
Ejemplo n.º 7
0
 public void HandlePlacementContentDismiss(TJPlacement placement)
 {
     if (placement.GetName() == "Video")
     {
         uiVideoLabel.text       = "Контент не загружен\n(видео)";
         loadingSpriteUI.enabled = false;
     }
 }
 private void RemovePlacement(TJPlacement placement)
 {
     if (!this._placementDic.ContainsKey(placement.GetName()))
     {
         return;
     }
     this._placementDic.Remove(placement.GetName());
 }
Ejemplo n.º 9
0
 public void HandlePlacementRequestFailure(TJPlacement placement, string error)
 {
     if (placement.GetName() == "Video")
     {
         uiVideoLabel.text       = "Ошибка запроса\n(видео)";
         loadingSpriteUI.enabled = false;
     }
 }
Ejemplo n.º 10
0
        private void OnRequestFailure(TJPlacement placement, string error)
        {
            this.requestSubscriber = Observable.Timer(TimeSpan.FromSeconds(this.reloadDelay))
                                     .Subscribe(_ => this.MakeRequestForAd());

            var errorMessage = $"Can't load the video reward. {error}";

            this.status.Value = new AdStatus(AdType.Rewarded, RequestStatus.LoadFailed, errorMessage);
        }
 public void HandlePlacementContentReady(TJPlacement placement)
 {
     Debug.Log ("C#: HandlePlacementContentReady");
     if (placement.IsContentAvailable ()) {
         //placement.ShowContent();
     } else {
         Debug.Log ("C#: no content");
     }
 }
Ejemplo n.º 12
0
 public void HandlePlacementRequestSuccess(TJPlacement placement)
 {
     if (placement.IsContentAvailable())
     {
         placement.ShowContent();
     }
     else
     {
         MyLog.D("C#: No content available for " + placement.GetName());
     }
 }
Ejemplo n.º 13
0
        public void Initialize()
        {
            this.placement = TJPlacement.CreatePlacement(this.placementId);
            this.MakeRequestForAd();

            TJPlacement.OnRequestFailure += this.OnRequestFailure;
            TJPlacement.OnContentReady   += this.OnContentReady;
            TJPlacement.OnContentDismiss += this.OnContentDismiss;
            TJPlacement.OnVideoStart     += this.OnVideoStart;
            TJPlacement.OnVideoComplete  += this.OnVideoComplete;
            TJPlacement.OnVideoError     += this.OnVideoError;
        }
Ejemplo n.º 14
0
 public void HandlePlacementContentReady(TJPlacement placement)
 {
     MyLog.D("C#: HandlePlacementContentReady");
     if (placement.IsContentAvailable())
     {
         placement.ShowContent();
     }
     else
     {
         MyLog.D("C#: no content");
     }
 }
Ejemplo n.º 15
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();
 }
 public void RequestPlacementContent(string placementName)
 {
     if (this._placementDic == null)
     {
         Debug.LogError("ERROR, FiveRocksEventListener.cs, RequestPlacementContent(), _placementDic is null");
         return;
     }
     if (!this._placementDic.ContainsKey(placementName))
     {
         TJPlacement value = TJPlacement.CreatePlacement(placementName);
         this._placementDic.Add(placementName, value);
     }
     this._placementDic[placementName].RequestContent();
 }
Ejemplo n.º 18
0
 public void HandlePlacementContentReady(TJPlacement placement)
 {
     if (placement.GetName() == "Video")
     {
         if (placement.IsContentAvailable())
         {
             uiVideoLabel.text = "Видео(загружено)\n+200 руб";
         }
         else
         {
             uiVideoLabel.text = "Нет контента\n(видео)";
         }
         loadingSpriteUI.enabled = false;
     }
 }
Ejemplo n.º 19
0
 public void HandlePlacementRequestSuccess(TJPlacement placement)
 {
     if (placement.GetName() == "Video")
     {
         if (placement.IsContentAvailable())
         {
             uiVideoLabel.text = "Смотреть видео\n+200 руб";
         }
         else
         {
             uiVideoLabel.text = "Нет контента\n(видео)";
         }
         loadingSpriteUI.enabled = false;
     }
 }
Ejemplo n.º 20
0
    // Use this for initialization
    void Start()
    {
        // Preload direct play event
        gameOver = TJPlacement.CreatePlacement("GameOver");
        onPause  = TJPlacement.CreatePlacement("OnPause");
        onRecord = TJPlacement.CreatePlacement("OnRecord");

        TJPlacement[] placements = { gameOver, onRecord, onPause };
        for (int i = 0; i < placements.Length; i++)
        {
            if (placements[i] != null)
            {
                placements[i].RequestContent();
            }
        }
    }
Ejemplo n.º 21
0
        /// <summary>
        /// Shows a specific TapJoy placement if it's not null.
        /// </summary>
        /// <param name="nullMessage">This message will be logged to the console if the placement is null.</param>
        protected virtual void ShowPlacement(TJPlacement placement, string nullMessage = "Attempting to show a null Tapjoy placement.")
        {
            if (!IsInitialized)
            {
                Debug.Log("The TapJoy network is not ready...");
                return;
            }

            if (placement == null)
            {
                Debug.Log(nullMessage);
                return;
            }

            placement.ShowContent();
        }
Ejemplo n.º 22
0
    public void HandlePlacementRequestSuccess(TJPlacement placement)
    {
        Debug.Log("C#: Content available for " + placement.GetName());

        if (placement.GetName() == "Ad_Video")
        {
            videoReady = true;
        }
        else if (placement.GetName() == "InterSticial")
        {
            IntterAdReady = true;
        }
        else
        {
            offerReady = true;
        }
    }
Ejemplo n.º 23
0
    void OnEnable()
    {
        Debug.Log("C# PlacementExample Enable -- Adding Tapjoy Placement delegates");

        // Placement Delegates
        TJPlacement.OnRequestSuccess  += HandlePlacementRequestSuccess;
        TJPlacement.OnRequestFailure  += HandlePlacementRequestFailure;
        TJPlacement.OnContentReady    += HandlePlacementContentReady;
        TJPlacement.OnContentShow     += HandlePlacementContentShow;
        TJPlacement.OnContentDismiss  += HandlePlacementContentDismiss;
        TJPlacement.OnPurchaseRequest += HandleOnPurchaseRequest;
        TJPlacement.OnRewardRequest   += HandleOnRewardRequest;

        // Tapjoy Placement Video Delegates
        TJPlacement.OnVideoStart    += HandleVideoStart;
        TJPlacement.OnVideoError    += HandleVideoError;
        TJPlacement.OnVideoComplete += HandleVideoComplete;

        // Currency Delegates
        Tapjoy.OnAwardCurrencyResponse             += HandleAwardCurrencyResponse;
        Tapjoy.OnAwardCurrencyResponseFailure      += HandleAwardCurrencyResponseFailure;
        Tapjoy.OnSpendCurrencyResponse             += HandleSpendCurrencyResponse;
        Tapjoy.OnSpendCurrencyResponseFailure      += HandleSpendCurrencyResponseFailure;
        Tapjoy.OnGetCurrencyBalanceResponse        += HandleGetCurrencyBalanceResponse;
        Tapjoy.OnGetCurrencyBalanceResponseFailure += HandleGetCurrencyBalanceResponseFailure;
        Tapjoy.OnEarnedCurrency += HandleEarnedCurrency;

        // Preload direct play placement
        if (directPlayPlacement == null)
        {
            directPlayPlacement = TJPlacement.CreatePlacement("video_unit");
            if (directPlayPlacement != null)
            {
                directPlayPlacement.RequestContent();
            }
        }

        // Create offerwall placement
        if (offerwallPlacement == null)
        {
            offerwallPlacement = TJPlacement.CreatePlacement("offerwall_unit");
        }

        InitUI();
    }
Ejemplo n.º 24
0
        /// <summary>
        /// Checks the placement name and invoke right completed event.
        /// </summary>
        /// Called in HandleTJPlacementOnVideoComplete event handler.
        protected virtual void InvokePlacementCompleteEvent(TJPlacement tjPlacement)
        {
            if (mAdSettings == null || tjPlacement == null)
            {
                Debug.Log("Null value(s)!!!");
                return;
            }

            string targetName = tjPlacement.GetName();

            /// Check if the tjPlacement is the default interstitial placement.
            if (mDefaultInterstitialPlacement != null && mDefaultInterstitialPlacement.GetName().Equals(targetName))
            {
                OnInterstitialAdCompleted(AdPlacement.Default);
                return;
            }

            /// Check if the tjPlacement is the default rewarded video placement.
            if (mDefaultRewaredVideoPlacement != null && mDefaultRewaredVideoPlacement.GetName().Equals(targetName))
            {
                OnRewardedAdCompleted(AdPlacement.Default);
                return;
            }

            /// Check if the tjPlacement is one of loaded custom interstitial ads.
            AdPlacement adPlacement = GetAdPlacementFromTJPlacement(mCustomInterstitialPlacements, targetName);

            if (adPlacement != null)
            {
                OnInterstitialAdCompleted(adPlacement);
                return;
            }

            /// Check if the tjPlacement is one of loaded custom rewarded video ads.
            adPlacement = GetAdPlacementFromTJPlacement(mCustomRewardedPlacements, targetName);
            if (adPlacement != null)
            {
                OnRewardedAdCompleted(adPlacement);
                return;
            }

            /// Otherwise
            Debug.LogWarning("Tried to invoke completed event of an unexpected custom placement. Name: " + targetName);
        }
Ejemplo n.º 25
0
    void OnEnable()
    {
        Tapjoy.OnConnectSuccess       += HandleConnectSuccess;
        Tapjoy.OnConnectFailure       += HandleConnectFailure;
        TJPlacement.OnRequestSuccess  += HandlePlacementRequestSuccess;
        TJPlacement.OnRequestFailure  += HandlePlacementRequestFailure;
        TJPlacement.OnContentReady    += HandlePlacementContentReady;
        TJPlacement.OnContentShow     += HandlePlacementContentShow;
        TJPlacement.OnContentDismiss  += HandlePlacementContentDismiss;
        TJPlacement.OnPurchaseRequest += HandleOnPurchaseRequest;
        TJPlacement.OnRewardRequest   += HandleOnRewardRequest;
        // Currency Delegatesåå
        Tapjoy.OnGetCurrencyBalanceResponse += HandleGetCurrencyBalanceResponse;
        Tapjoy.OnEarnedCurrency             += HandleEarnedCurrency;
        if (isInitted)
        {
            if (BannerAd == null)
            {
                BannerAd = TJPlacement.CreatePlacement("Video");
                if (BannerAd != null)
                {
                    BannerAd.RequestContent();
                }
            }

            if (offerwallPlacement == null)
            {
                offerwallPlacement = TJPlacement.CreatePlacement("Wall");
                if (offerwallPlacement != null)
                {
                    offerwallPlacement.RequestContent();
                }
            }
            if (IntterAd == null)
            {
                IntterAd = TJPlacement.CreatePlacement("Pop");
                if (IntterAd != null)
                {
                    IntterAd.RequestContent();
                }
            }
        }
    }
Ejemplo n.º 26
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());
     }
 }
Ejemplo n.º 27
0
    void OnEnable()
    {
        // Offers Delegates
        Tapjoy.OnOffersResponse += HandleShowOffers;

        // Placement Delegates
        TJPlacement.OnRequestSuccess += HandlePlacementRequestSuccess;
        TJPlacement.OnRequestFailure += HandlePlacementRequestFailure;
        TJPlacement.OnContentReady   += HandlePlacementContentReady;
        TJPlacement.OnContentShow    += HandlePlacementContentShow;
        TJPlacement.OnContentDismiss += HandlePlacementContentDismiss;
        //TJPlacement.OnPurchaseRequest += HandleOnPurchaseRequest;
        //TJPlacement.OnRewardRequest += HandleOnRewardRequest;

        // Tapjoy Video Delegates
        //Tapjoy.OnVideoStart += HandleVideoStart;
        Tapjoy.OnVideoError += HandleVideoError;

        // Preload direct play event
        video      = TJPlacement.CreatePlacement("Video");
        gameLaunch = TJPlacement.CreatePlacement("GameLaunch");
        onPause    = TJPlacement.CreatePlacement("OnPause");
        offerwall  = TJPlacement.CreatePlacement("Offerwall");

        TJPlacement[] placements = { video, gameLaunch, onPause, offerwall };
        for (int i = 0; i < placements.Length; i++)
        {
            if (placements[i] != null)
            {
                placements[i].RequestContent();
            }
        }

        Tapjoy.GetCurrencyBalance();
        //Tapjoy.
        //ShowGameLaunchPlacement();
    }
Ejemplo n.º 28
0
    public void HandleConnectSuccess()
    {
        Debug.Log("tapjoy Connect Success ");
        Tapjoy.GetCurrencyBalance();

        isInitted = true;
        if (isInitted)
        {
            if (BannerAd == null)
            {
                BannerAd = TJPlacement.CreatePlacement("Ad_Video");
                if (BannerAd != null)
                {
                    BannerAd.RequestContent();
                }
            }

            if (offerwallPlacement == null)
            {
                offerwallPlacement = TJPlacement.CreatePlacement("Ad_OfferWall");
                if (offerwallPlacement != null)
                {
                    offerwallPlacement.RequestContent();
                }
            }
            if (IntterAd == null)
            {
                IntterAd = TJPlacement.CreatePlacement("InterSticial");
                if (IntterAd != null)
                {
                    IntterAd.RequestContent();
                }
            }
        }
        PS_Plugin.Instance.OnTJInitComplete(true);
    }
Ejemplo n.º 29
0
 public override void OnContentReady(TJPlacement p0)
 {
     base.OnContentReady(p0);
     if (!GetInstance().app.Settings.StreamActivated)
     {
         p0.ShowContent();
     }
 }
 public void HandlePlacementContentDismiss(TJPlacement placement)
 {
     Debug.Log ("C#: HandlePlacementContentDismiss");
 }
 void HandleOnRewardRequest(TJPlacement placement, TJActionRequest request, string itemId, int quantity)
 {
     Debug.Log ("C#: HandleOnRewardRequest");
     request.Completed ();
 }
 void HandleOnPurchaseRequest(TJPlacement placement, TJActionRequest request, string productId)
 {
     Debug.Log ("C#: HandleOnPurchaseRequest");
     request.Completed ();
 }
    void OnEnable()
    {
        Debug.Log ("C# PlacementExample Enable -- Adding Tapjoy Placement delegates");

        // Placement Delegates
        TJPlacement.OnRequestSuccess += HandlePlacementRequestSuccess;
        TJPlacement.OnRequestFailure += HandlePlacementRequestFailure;
        TJPlacement.OnContentReady += HandlePlacementContentReady;
        TJPlacement.OnContentShow += HandlePlacementContentShow;
        TJPlacement.OnContentDismiss += HandlePlacementContentDismiss;
        TJPlacement.OnPurchaseRequest += HandleOnPurchaseRequest;
        TJPlacement.OnRewardRequest += HandleOnRewardRequest;

        // Currency Delegates
        Tapjoy.OnAwardCurrencyResponse += HandleAwardCurrencyResponse;
        Tapjoy.OnAwardCurrencyResponseFailure += HandleAwardCurrencyResponseFailure;
        Tapjoy.OnSpendCurrencyResponse += HandleSpendCurrencyResponse;
        Tapjoy.OnSpendCurrencyResponseFailure += HandleSpendCurrencyResponseFailure;
        Tapjoy.OnGetCurrencyBalanceResponse += HandleGetCurrencyBalanceResponse;
        Tapjoy.OnGetCurrencyBalanceResponseFailure += HandleGetCurrencyBalanceResponseFailure;
        Tapjoy.OnEarnedCurrency += HandleEarnedCurrency;

        // Tapjoy Video Delegates
        Tapjoy.OnVideoStart += HandleVideoStart;
        Tapjoy.OnVideoError += HandleVideoError;
        Tapjoy.OnVideoComplete += HandleVideoComplete;

        // Preload direct play placement
        if (directPlayPlacement == null) {
            directPlayPlacement = TJPlacement.CreatePlacement ("video_unit");
            if (directPlayPlacement != null) {
                directPlayPlacement.RequestContent ();
            }
        }

        // Create offerwall placement
        if (offerwallPlacement == null) {
            offerwallPlacement = TJPlacement.CreatePlacement ("offerwall_unit");
        }

        InitUI ();
    }
 public void HandlePlacementContentDismiss(TJPlacement placement)
 {
     Debug.Log ("C#: HandlePlacementContentDismiss");
     contentIsReadyForPlacement = false;
     output = "TJPlacement " + placement.GetName () + " has been dismissed";
 }
 public void HandlePlacementContentShow(TJPlacement placement)
 {
     Debug.Log ("C#: HandlePlacementContentShow");
 }
Ejemplo n.º 36
0
 public virtual void OnRewardRequest(TJPlacement p0, ITJActionRequest request, string p2, int p3)
 {
     Log.Debug(TAG, string.Format("OnRewardRequest: {0}", p0.Name));
     request.Completed();
 }
Ejemplo n.º 37
0
 public virtual void OnRequestSuccess(TJPlacement p0)
 {
     Log.Debug(TAG, string.Format("OnRequestSuccess: {0}", p0.Name));
 }
Ejemplo n.º 38
0
 public virtual void OnRequestFailure(TJPlacement p0, TJError p1)
 {
     Log.Error(TAG, string.Format("OnRequestFailure: {0}", p1.Message));
 }
Ejemplo n.º 39
0
 public virtual void OnPurchaseRequest(TJPlacement p0, ITJActionRequest p1, string p2)
 {
     Log.Debug(TAG, string.Format("OnPurchaseRequest: {0}", p0.Name));
 }
Ejemplo n.º 40
0
 private void OnVideoComplete(TJPlacement tjPlacement)
 {
     this.status.Value = new AdStatus(AdType.Rewarded, RequestStatus.ShowSuccess, String.Empty);
     this.MakeRequestForAd();
 }
 public void HandlePlacementRequestFailure(TJPlacement placement, string error)
 {
     Debug.Log ("C#: HandlePlacementRequestFailure");
     Debug.Log ("C#: Request for " + placement.GetName () + " has failed because: " + error);
 }
Ejemplo n.º 42
0
 public override void OnRewardRequest(TJPlacement p0, ITJActionRequest request, string p2, int p3)
 {
     Log.Debug(TAG, string.Format("OnStreamRewardRequest: {0}", p0.Name));
     EnableStreamFeature();
     request.Completed();
 }
    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 ());
        }
    }
Ejemplo n.º 44
0
            public override void OnContentDismiss(TJPlacement p0)
            {
                Log.Debug(TAG, string.Format("OnStreamContentDismiss: {0}", p0.Name));

            }
    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 OnCreateDirectPlayTapped()
 {
     // Create direct play placement
     if (directPlayPlacement == null) {
         directPlayPlacement = TJPlacement.CreatePlacement ("video_unit");
         if (directPlayPlacement != null) {
             directPlayPlacement.RequestContent ();
         }
     }
 }
Ejemplo n.º 47
0
 private void OnContentReady(TJPlacement placement)
 {
     this.status.Value = new AdStatus(AdType.Rewarded, RequestStatus.LoadSuccess, String.Empty);
 }
 public void OnCreateOfferwallTapped()
 {
     // Create offerwall placement
     if (offerwallPlacement == null) {
         offerwallPlacement = TJPlacement.CreatePlacement ("offerwall_unit");
     }
 }
Ejemplo n.º 49
0
 private void OnVideoStart(TJPlacement tjPlacement)
 {
     this.status.Value = new AdStatus(AdType.Rewarded, RequestStatus.ShowStarted, String.Empty);
 }
Ejemplo n.º 50
0
 public virtual void OnContentDismiss(TJPlacement p0)
 {
     Log.Debug(TAG, string.Format("OnContentDismiss: {0}", p0.Name));
     UpdateBalance();
     p0.RequestContent();
 }
Ejemplo n.º 51
0
 private void OnVideoError(TJPlacement tjPlacement, string errorMessage)
 {
     this.status.Value = new AdStatus(AdType.Rewarded, RequestStatus.ShowFailed, errorMessage);
     this.MakeRequestForAd();
 }
Ejemplo n.º 52
0
 public virtual void OnContentShow(TJPlacement p0)
 {
     Log.Debug(TAG, string.Format("OnContentShow: {0}", p0.Name));
 }