Last active
April 19, 2016 08:55
-
-
Save keewon/394ef9cd38b676be537ae1aaace5fd72 to your computer and use it in GitHub Desktop.
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 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