playMaker

Author Topic: Unity Ads  (Read 30412 times)

marcos

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 199
Unity Ads
« on: September 05, 2014, 06:01:52 AM »
Hey,

Would be great to have a set of actions for Unity Ads:

https://www.assetstore.unity3d.com/en/#!/content/21027

Regards,
Mark.

Fahrettin

  • Junior Playmaker
  • **
  • Posts: 62
  • Noob
Re: Unity Ads
« Reply #1 on: September 07, 2014, 03:48:19 AM »
No answer for Unity Ads ?

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Unity Ads
« Reply #2 on: September 07, 2014, 11:12:21 PM »
I'm making the actions now ... :)

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Unity Ads
« Reply #3 on: September 07, 2014, 11:42:42 PM »

Fahrettin

  • Junior Playmaker
  • **
  • Posts: 62
  • Noob
Re: Unity Ads
« Reply #4 on: September 08, 2014, 07:16:26 AM »
Thanks LampRabbit  ;)

marcos

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 199
Re: Unity Ads
« Reply #5 on: September 08, 2014, 10:52:36 PM »
Oh wow!

Thank you, sir!

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Unity Ads
« Reply #6 on: September 08, 2014, 11:10:29 PM »
np, I'll be adding allowPrecache, isInitialized, isShowing and isSupported actions as well as a separate isReady/show ad action when I get time.

PaulH

  • Junior Playmaker
  • **
  • Posts: 50
Re: Unity Ads
« Reply #7 on: December 08, 2014, 01:26:25 PM »
np, I'll be adding allowPrecache, isInitialized, isShowing and isSupported actions as well as a separate isReady/show ad action when I get time.

Hi LampRabbit

did you ever do the other actions you mentioned above? i could really use them now. especially the isInitialized, because i noticed if there is a slow internet connection while unity ads are being initialized, it can almost crash your game if the user tries to play it at the same time they are being initialized.

so i would like to be able to check if in fact they are initialiezed before the user can play.

cheers.

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Unity Ads
« Reply #8 on: December 08, 2014, 11:02:52 PM »
Check out the post by cloud03

http://hutonggames.com/playmakerforum/index.php?topic=8311.0

What I do is stop inputs and then show the ad with the engine being paused. Then when the engine is unpaused I wait a fraction of time and then turn inputs back on.
« Last Edit: December 09, 2014, 12:54:50 AM by LampRabbit »

PaulH

  • Junior Playmaker
  • **
  • Posts: 50
Re: Unity Ads
« Reply #9 on: December 10, 2014, 10:47:10 AM »
Check out the post by cloud03

http://hutonggames.com/playmakerforum/index.php?topic=8311.0

What I do is stop inputs and then show the ad with the engine being paused. Then when the engine is unpaused I wait a fraction of time and then turn inputs back on.

could i ask one more favor? do you know how i check if the user actually finished watching the video ad? because as it is now in my game, the user watches the vid (using the 2 actions we have available init and show) and then once finished i give the reward on the next state. I do it this way because i don't know how to set up the reward system in unity ads.

but...my problem is, if the user (on ios) hits the home button on ipad/iphone etc while the ad is playing and then starts the app straight back up, they cut the ad off and then get the reward without actually watching it. I just need to do a quick check to see if they actually finished the ad so i can then proceed to give the reward if they did, if not then i dont.

i found this onVideoCompleted(String itemKey, boolean skipped) but i dont know how to implement it.

Thanks in advance for your help.


escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Unity Ads
« Reply #10 on: December 10, 2014, 04:11:27 PM »
I don't think his can be done with an action, will add it to my long list.

PaulH

  • Junior Playmaker
  • **
  • Posts: 50
Re: Unity Ads
« Reply #11 on: December 10, 2014, 04:35:55 PM »
I don't think his can be done with an action, will add it to my long list.

i think this is the code for it in bold:


    public static void ShowAd (string zone = null, bool pauseGameDuringAd = true)
    {
        if (string.IsNullOrEmpty(zone)) zone = null;
     
        ShowOptions options = new ShowOptions();
        options.pause = pauseGameDuringAd;
        options.resultCallback = HandleShowResult;
       
        Advertisement.Show(zone,options);
    }
       
    public static void HandleShowResult (ShowResult result)
    {
        switch (result)
        {
        case ShowResult.Finished:
            Debug.Log("The ad was successfully shown.");
            break;
        case ShowResult.Skipped:
            Debug.Log("The ad was skipped before reaching the end.");
            break;
        case ShowResult.Failed:
            Debug.LogError("The ad failed to be shown.");
            break;
        }
    }



am i right in thinking the action would just need an playmaker FSM.event for each of the cases in the switch statement?

http://forum.unity3d.com/threads/question-concerning-video-adds-return-value.279849/

i think thats all it needs but i dont know how to do it. when i add a fsm.event to each of them i get an error.

this is the last thing i need before i click submit to the app store, so i would be so grateful if you could take a look.

cheers.
« Last Edit: December 10, 2014, 04:38:27 PM by PaulH »

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Unity Ads
« Reply #12 on: December 10, 2014, 04:53:54 PM »
Hmmm, might have to give cloud03 a personal message, I'm not sure how to handle that ... I still think a proxy script might be needed but I could be wrong :S

rik

  • Full Member
  • ***
  • Posts: 246
Re: Unity Ads
« Reply #13 on: December 12, 2014, 01:42:07 AM »
Hi can some one tell me which plugin was good for admob playmaker integration i am trying to use admob with playmaker using android native but there is no plamaker scene can some one help me.

problem is ad id was string but playmaker action was int so i cannot paste my admob id some one using this can guide me

xhidnoda

  • Full Member
  • ***
  • Posts: 231
Re: Unity Ads
« Reply #14 on: January 05, 2015, 03:56:16 PM »
Hi...!
there are a unity package for this? :P