Skip to content

Instantly share code, notes, and snippets.

@keewon
Last active April 19, 2016 08:55
Show Gist options
  • Save keewon/394ef9cd38b676be537ae1aaace5fd72 to your computer and use it in GitHub Desktop.
Save keewon/394ef9cd38b676be537ae1aaace5fd72 to your computer and use it in GitHub Desktop.
using UnityEngine;
using System.Collections;
using TapjoyUnity;
public class Tapjoy1 : MonoBehaviour {
int count = 0;
TJPlacement p;
// Use this for initialization
void Start () {
Tapjoy.OnConnectSuccess += HandleOnConnectSuccess;
}
void HandleOnConnectSuccess ()
{
TJPlacement.OnContentReady += HandleOnContentReady;
p = TJPlacement.CreatePlacement("offerwall_unit");
p.RequestContent();
count = 1;
}
void HandleOnContentReady (TJPlacement placement)
{
placement.ShowContent();
count = 600;
}
// Update is called once per frame
void Update () {
if (count > 0) {
count--;
Debug.Log ("count: " + count);
if (count <= 0) {
count = 0;
//TJPlacement.DismissContent();
//System.GC.Collect();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment