Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: doppelmonster on June 07, 2013, 08:34:00 AM
-
Hi,
im just trying to implement a Monetization Network into my game and connect it to my Playmaker FSM. In the moment im trying "Revmob" and "Play Haven". I struggle at the communication between Playmaker and the Network scripts.
For Playhaven:
i try to implement the "More Games" feature. therefore i should:
With only the PlayHaven Manager in your scene you can invoke
the “More Games” feature in your gameʼs GUI by calling the
PlayHavenManager.instance.ShowCrossPromotionWidget()
method.
I try to do so by using the "create object" and "invoke method" action (see screenshot)
But i get the following error: InvokeMethod: PlayHavenManager missing behaviour: PlayHaven.PlayHavenManager
That is strange because why i am able to select the behaviour in the action when it is later missing?
For Revmob:
Fullscreen is a ad unit with a high eCPM. You can show it in the beginning or in the end of a round, for example.
To show a Fullscreen ad in your application, you can simply call the showFullscreen method:
public class GameObject : MonoBehaviour {
void Start() {
revmob.ShowFullscreen();
}
}
I have no clue how i can call this from Playmaker. "Invoke Method" dont find
revmob.ShowFullscreen(); as an option...
So if someone could point me in the right direction, its highly appreciated!
-
Hi,
you can't call invoke here, because it the method is part of a singleton.
you will have to implement a custom action for this.
create a new script and copy paste the content of the action "application Quit",
-- rename the class properly, refactor the tooltips and replace the line
Application.Quit();
with
PlayHavenManager.instance.ShowCrossPromotionWidget()
if you have trouble doing this, let me know, I'll do the custom action for you.
Same with revmob, you would do a special action for it and put that line the same way.
bye,
Jean
-
Hi Jean,
thanks for your support.
Im sorry but i dont get it to work.
For Play Haven i used this code:
// (c) Copyright HutongGames, LLC 2010-2011. All rights reserved.
namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.ScriptControl)]
[Tooltip("Call the More Games feature of the Play Haven plugin")]
public class CallPlayhavenGames : FsmStateAction
{
public override void Reset()
{
}
public override void OnEnter()
{
PlayHavenManager.instance.ShowCrossPromotionWidget();
Finish();
}
}
}
and get this error:
Assets/PlayMaker/Actions/CallPlayhavenGames.cs(15,17): error CS0103: The name `PlayHavenManager' does not exist in the current context
so i understand that i have to define the Gameobject: PlayHavenManager in the action. But there i fail integrating a Gameobject var...
Not to speak about Revmob...
-
For Play Haven i think i solved it:
I just have to use "send message" action with: "ShowCrossPromotionWidget" sended to the PlayHavenManager GO.
Now i get an dummy ad displayed.
An example for Revmob is still appreciated :)
-
Hi,
I don't own RevMob, so this is just following their docs:
http://sdk.revmob.com/unity
you would have something like this for example:
// (c) Copyright HutongGames, LLC 2010-2011. All rights reserved.
namespace HutongGames.PlayMaker.Actions
{
[ActionCategory("RevMob)]
[Tooltip("Display a banner using RevMob plugin")]
public class DisplayRevMobBanner : FsmStateAction
{
public override void OnEnter()
{
#if (UNITY_IPHONE && !UNITY_EDITOR)
RevMobIOSBAnner banner = revmob.CreateBanner();
banner.Show();
#endif
Finish();
}
}
}
bye,
Jean
-
Thanks Jean,
i will try your code!