Last active
December 15, 2015 23:10
-
-
Save jaredjenkins/5338781 to your computer and use it in GitHub Desktop.
Unity Messaging
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using PlaynomicsPlugin; | |
using UntiyEngine; | |
public class Scene : MonoBehavior { | |
private MessagingFrame frame; | |
private bool shown; | |
private void Awake(){ | |
MessagingFrame frame = Playnomics.instance.initMessagingFrame(<PLAYNOMICS-FRAME-ID>); | |
//enabled code callbacks, eg PNA | |
frame.EnableAdCode = true; | |
} | |
private void Update(){ | |
if(frame.FrameState == FrameStateEnum.Loaded && !shown){ | |
//the frame is ready and has never been shown | |
shown = true; | |
//render the frame | |
frame.show(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment