Created
November 8, 2012 16:52
-
-
Save revmob-sdk/4040022 to your computer and use it in GitHub Desktop.
Unity sdk 2
This file contains hidden or 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 System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class RevMobGameObject : MonoBehaviour, IRevMobListener | |
{ | |
// Just replace the IDs below with your appIDs. | |
private static readonly Dictionary<String, String> appIds = new Dictionary<String, String>() { | |
{ "Android", "4f56aa6e3dc441000e005a20"}, | |
{ "IOS", "4fd619388d314b0008000213" } | |
}; | |
private static readonly int X = 100; | |
private static readonly int Y = 100; | |
private static readonly int BUTTON_WIDTH = 200; | |
private static readonly int BUTTON_HEIGHT = 80; | |
private RevMob revmob; | |
private AdLink link; | |
public void Awake() { | |
revmob = RevMob.Start(appIds, "RevMobGameObject"); | |
} | |
public void Start() { | |
link = revmob.CreateAdLink(); | |
} | |
public void OnGUI() { | |
if (link != null && link.IsAdLoaded()) { | |
if ( GUI.Button(new Rect(X, Y, BUTTON_WIDTH, BUTTON_HEIGHT), "Open Link") ) { | |
adLink.Open(); | |
adLink = null; | |
return; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment