playMaker

Author Topic: UnityAds  (Read 24746 times)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14501
  • Official Playmaker Support
    • View Profile
Re: UnityAds
« Reply #45 on: July 16, 2015, 04:04:20 AM »
Hi,

 yep, it looks like they will need a revamp for Unity 5.

locally for you, I would simply implement their suggestions as they explain what should be used instead.

I want to add them to the ecosystem, so if you have some time, I think next week can be a reasonable target for me to put them on the Ecosystem, compliant with Unity 5.

Bye,

 Jean

szomaza

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Re: UnityAds
« Reply #46 on: July 16, 2015, 10:21:19 PM »
Hi,

It would be great to have them in the Ecosystem, in a patched up state!
But unfortunately I am pretty sure "simply implementing their suggestions" is still out of my ballpark.  :-)

br,
szomaza

playsteven

  • Junior Playmaker
  • **
  • Posts: 75
    • View Profile
Re: UnityAds
« Reply #47 on: July 23, 2015, 01:51:44 AM »
Hi,

Has anybody been able to get UnityAds working in Unity 5?

I'm submitting a game next week and want to look at my video ad options :)

All the best,
Steven

dougbello

  • Playmaker Newbie
  • *
  • Posts: 32
    • View Profile
Re: UnityAds
« Reply #48 on: July 28, 2015, 12:06:33 PM »
Please, make it available on the ecosystem working for unity 5...

I'm feeling that playmaker support is little slow right now. Everything I ask for ... not working, no answers....

I'm not happy here.

Felling that have to learn how to code or I'll just have half of the options to work with unity.

dougbello

  • Playmaker Newbie
  • *
  • Posts: 32
    • View Profile
Re: UnityAds
« Reply #49 on: July 28, 2015, 12:23:07 PM »
I don't know if it make it easier but here is the code official from unity:

using UnityEngine;
using System.Collections;
using UnityEngine.Advertisements;

public class AdManager : MonoBehaviour
{
    [SerializeField] string gameID = "33675";

    void Awake()
    {
        Advertisement.Initialize (gameID, true);
    }

    public void ShowAd(string zone = "")
    {
        #if UNITY_EDITOR
            StartCoroutine(WaitForAd ());
        #endif

        if (string.Equals (zone, ""))
            zone = null;

        ShowOptions options = new ShowOptions ();
        options.resultCallback = AdCallbackhandler;

        if (Advertisement.isReady (zone))
            Advertisement.Show (zone, options);
    }

    void AdCallbackhandler (ShowResult result)
    {
        switch(result)
        {
        case ShowResult.Finished:
            Debug.Log ("Ad Finished. Rewarding player...");
            break;
        case ShowResult.Skipped:
            Debug.Log ("Ad skipped. Son, I am dissapointed in you");
            break;
        case ShowResult.Failed:
            Debug.Log("I swear this has never happened to me before");
            break;
        }
    }

    IEnumerator WaitForAd()
    {
        float currentTimeScale = Time.timeScale;
        Time.timeScale = 0f;
        yield return null;

        while (Advertisement.isShowing)
            yield return null;

        Time.timeScale = currentTimeScale;
    }
}

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14501
  • Official Playmaker Support
    • View Profile
Re: UnityAds
« Reply #50 on: September 18, 2015, 05:55:03 AM »
Hi,

 UnityAds for Unity 5 is now fully covered with actions you can get on the Ecosystem



you'll mainly need "UnityAdsShowAd", as it account for both regular and reward based advertising, and will wait for ads to be ready is not already, so the action in itself covers everything you need, the other actions are for full coverage to give you access to everything if you want granular control.


 Bye,

 Jean

xhidnoda

  • Full Member
  • ***
  • Posts: 231
    • View Profile
Re: UnityAds
« Reply #51 on: September 18, 2015, 06:04:18 AM »
@jeanfabre like always you make a great job!

I will test this in my game in a few weeks.

dougbello

  • Playmaker Newbie
  • *
  • Posts: 32
    • View Profile
Re: UnityAds
« Reply #52 on: September 18, 2015, 09:16:57 AM »
Hi Jean, thanks a lot!

I'm testing in my game, but it gets stuck on the show Ads event and does not go anywhere. I tried building it also and it doesn't show.

It starts but does not go anywhere, I tried with and without "Is not ready event"and ge the same result, It keeps on this node.

Maybe I'm doing something wrong, but it was working fine with the previous version from LampRabbit.

Thanks again.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14501
  • Official Playmaker Support
    • View Profile
Re: UnityAds
« Reply #53 on: September 18, 2015, 09:33:43 AM »
Hi,

 that's odd, I did test it on device and it's working.

have you tried without gamersid?

what does it do inside the editor?


 Bye,

 Jean

dougbello

  • Playmaker Newbie
  • *
  • Posts: 32
    • View Profile
Re: UnityAds
« Reply #54 on: September 21, 2015, 02:52:06 PM »
Hi Jean, I've been testing since saturday to make sure its nothing stupid i'm doing..(probably is)

I created a new project, imported the assets and I'm getting the same behaviour...

Using unity 5.2.0f3 Personal

Here is a screen record of it... (if you download the movie it's full quality)

https://www.dropbox.com/s/b52apecu6s0shws/unity_ads_playmaker.mov?dl=0

Maybe it help us to understand.

Thanks again.
Doug.
« Last Edit: September 21, 2015, 03:05:18 PM by dougbello »

dougbello

  • Playmaker Newbie
  • *
  • Posts: 32
    • View Profile
Re: UnityAds
« Reply #55 on: September 23, 2015, 07:36:12 PM »
Someone else tested it?

Is it working ok?

Thanks.
Doug.

dougbello

  • Playmaker Newbie
  • *
  • Posts: 32
    • View Profile
Re: UnityAds
« Reply #56 on: September 23, 2015, 07:58:54 PM »
Now it's giving me this error:

Assets/PlayMaker Custom Actions/UnityAds/UnityAdsShowAd.cs(108,55): error CS0433: The imported type `UnityEngine.Advertisements.ShowResult' is defined multiple times

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14501
  • Official Playmaker Support
    • View Profile
Re: UnityAds
« Reply #57 on: September 23, 2015, 10:39:56 PM »
Hi,

 it looks like you are conflicting several version of Unity advertisement now,

And it seems that you haven't setup at all the ad service within Unity. Did you go through the steps necessary to allow Unity ads?

1: click on the cloud icon
2: login
3: set up unity ads



Then it should work. From your previous posts, it seems you don't mentino these steps.

 so start on a fresh project, setup ads first, then run the sample provided.

http://forum.unity3d.com/threads/issues-in-migrating-to-5-2.353849/

Let me know how it goes.

 Bye,

 Jean
« Last Edit: September 23, 2015, 10:54:17 PM by jeanfabre »

MUX

  • Playmaker Newbie
  • *
  • Posts: 43
    • View Profile
    • @stefstivala
Re: UnityAds
« Reply #58 on: September 23, 2015, 11:36:05 PM »
this unfortunately doesn't work for me either.
  • i have installed new actions from the ecosystem
  • i have set up unity ads in services

no errors to tell me why. ad just remains unready.

MUX

  • Playmaker Newbie
  • *
  • Posts: 43
    • View Profile
    • @stefstivala
Re: UnityAds
« Reply #59 on: September 23, 2015, 11:54:08 PM »
edit - ok got it to work now.
have unity bypassed the ad-type now?
that what has stopped it from working

before i used pass it either -
defaultVideoAndPictureZone
pictureZone
rewardedVideoZone

now when i add a value, ads dont work