Skip to content

Instantly share code, notes, and snippets.

@jaredjenkins
Last active December 15, 2015 23:10
Show Gist options
  • Save jaredjenkins/5338781 to your computer and use it in GitHub Desktop.
Save jaredjenkins/5338781 to your computer and use it in GitHub Desktop.
Unity Messaging
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