private void Awake() { base.gameObject.name = base.GetType().ToString(); TapjoyPlugin.SetCallbackHandler(base.gameObject.name); Debug.Log("C#: UnitySendMessage directs to " + base.gameObject.name); UnityEngine.Object.DontDestroyOnLoad(this); }
public void ShowOffers() { if (!TapjoyManager.isTapJoyEnabled || TapjoyManager.offerWallOpen) { return; } if (!TapjoyManager.DidConnectSucceed) { return; } if (!TapjoyManager.isUserIDSet) { string playerId = Service.Get <CurrentPlayer>().PlayerId; if (string.IsNullOrEmpty(playerId)) { return; } this.SetUserId(); } if (Service.IsSet <AudioManager>()) { Service.Get <AudioManager>().ToggleAllSounds(false); } TapjoyManager.offerWallOpen = true; if (Service.IsSet <GameIdleController>()) { Service.Get <GameIdleController>().Enabled = false; } TapjoyPlugin.ShowOffers(); }
public void tapjoyHandleTapPointsEarned(int points) { LogUtil.Log("CurrencyEarned: " + points); //tapPointsLabel = "Currency Earned: " + points; TapjoyPlugin.ShowDefaultEarnedCurrencyAlert(); }
public void HandleGetDisplayAdSucceeded() { if (!TapjoyManager.mOpeningFullScreenAd) { TapjoyPlugin.ShowDisplayAd(); } }
public void HandleTapPointsEarned(int points) { Debug.Log("C#: CurrencyEarned: " + points); tapPointsLabel = "Currency Earned: " + points; PlayerPrefs.SetInt("Vidas", PlayerPrefs.GetInt("Vidas") + points); TapjoyPlugin.ShowDefaultEarnedCurrencyAlert(); }
public static void SetDisplayAdContentSize(int size) { if (Application.isEditor) { return; } TapjoyPlugin.SetDisplayAdSize((TapjoyDisplayAdSize)size); }
public void Send() { Debug.Log(string.Format("C#: Sending event {0} ", new object[] { this.myName })); TapjoyPlugin.SendEvent(this.myGuid); }
public TapjoyEvent(string eventName, string eventParameter, ITapjoyEvent callback) { myName = eventName; myParameter = eventParameter; myCallback = callback; myGuid = TapjoyPlugin.CreateEvent(this, eventName, eventParameter); Debug.Log(String.Format("C#: Event {0} created with GUID:{1} with Param:{2}", myName, myGuid, myParameter)); }
// DISPLAY ADS public void tapjoyHandleGetDisplayAdSucceeded() { LogUtil.Log("HandleGetDisplayAdSucceeded"); if (!tapjoyOpeningFullScreenAd) { TapjoyPlugin.ShowDisplayAd(); } }
public static void SetDisplayAdContentSize(int size) { if (Application.platform == RuntimePlatform.OSXEditor) { return; } TapjoyPlugin.SetDisplayAdSize((TapjoyDisplayAdSize)size); }
void Start() { #if UNITY_ANDROID // Attach our thread to the java vm; obviously the main thread is already attached but this is good practice.. if (Application.platform == RuntimePlatform.Android) { UnityEngine.AndroidJNI.AttachCurrentThread(); } #endif Dictionary <String, System.Object> connectFlags = new Dictionary <String, System.Object>(); // Connect to the Tapjoy servers. if (Application.platform == RuntimePlatform.Android) { // Enable logging connectFlags.Add(ENABLE_LOGGING_ANDROID, true); // If you are not using Tapjoy Managed currency, you would set your own user ID here. // connectFlags.Add("user_id", "A_UNIQUE_USER_ID"); // You can also set your event segmentation parameters here. // Dictionary<String, System.Object> segmentationParams = new Dictionary<String, System.Object>(); // segmentationParams.Add("iap", true); // connectFlags.Add("segmentation_params", segmentationParams); TapjoyPlugin.RequestTapjoyConnect("0143ffbe-3975-417d-b04f-6cf9b9fb30e6", // YOUR APP ID GOES HERE "DxEmLGJ6W3iiPxpup9rv", // YOUR SECRET KEY GOES HERE connectFlags); // YOUR CONNECT FLAGS } else if (Application.platform == RuntimePlatform.IPhonePlayer) { // Enable logging connectFlags.Add(ENABLE_LOGGING_IOS, true); // Add other connect flags connectFlags.Add("TJC_OPTION_COLLECT_MAC_ADDRESS", TapjoyPlugin.MacAddressOptionOffWithVersionCheck); // If you are not using Tapjoy Managed currency, you would set your own user ID here. // connectFlags.Add("TJC_OPTION_USER_ID", "A_UNIQUE_USER_ID"); // You can also set your event segmentation parameters here. // Dictionary<String, System.Object> segmentationParams = new Dictionary<String, System.Object>(); // segmentationParams.Add("iap", true); // connectFlags.Add("TJC_OPTION_SEGMENTATION_PARAMS", segmentationParams); TapjoyPlugin.RequestTapjoyConnect("0143ffbe-3975-417d-b04f-6cf9b9fb30e6", // YOUR APP ID GOES HERE "DxEmLGJ6W3iiPxpup9rv", // YOUR SECRET KEY GOES HERE connectFlags); // YOUR CONNECT FLAGS } }
// CONNECT public void HandleTapjoyConnectSuccess() { Debug.Log("C#: HandleTapjoyConnectSuccess"); // Get the user virtual currency TapjoyPlugin.GetTapPoints(); // Preload direct play event diectPlayEvent = new TapjoyEvent("video_unit", this); diectPlayEvent.EnablePreload(true); diectPlayEvent.Send(); }
public TapjoyEvent(string eventName, string eventParameter, ITapjoyEvent callback) { this.myName = eventName; this.myParameter = eventParameter; this.myCallback = callback; this.myGuid = TapjoyPlugin.CreateEvent(this, eventName, eventParameter); Debug.Log(string.Format("C#: Event {0} created with GUID:{1} with Param:{2}", new object[] { this.myName, this.myGuid, this.myParameter })); }
private void SetUserId() { if (!Service.IsSet <CurrentPlayer>()) { return; } string playerId = Service.Get <CurrentPlayer>().PlayerId; if (!string.IsNullOrEmpty(playerId)) { TapjoyPlugin.SetUserID(Service.Get <CurrentPlayer>().PlayerId); TapjoyManager.isUserIDSet = true; } }
void OnApplicationPause(bool pause) { Debug.Log("C#: Application Pause: " + pause + " expected transition: " + shouldTransition); if (!shouldTransition) { if (pause) { TapjoyPlugin.AppPause(); } else { TapjoyPlugin.AppResume(); } } }
void Update() { try { if (Input.GetMouseButtonDown(0)) { Vector2 mousePosition = CM.ScreenToWorldPoint(Input.mousePosition); Collider2D hitCollider = Physics2D.OverlapPoint(mousePosition); if (hitCollider.name == "BotaoComprarVidas") { Debug.Log("tapjoy"); shouldTransition = true; TapjoyPlugin.ShowOffers(); } } } catch { } }
// ---------------------------------------------------------------------- // TAPJOY - http://prime31.com/docs#comboVungle public void tapjoyInit() { // Enable logging. TapjoyPlugin.EnableLogging(true); // Connect to the Tapjoy servers. if (Application.platform == RuntimePlatform.Android) { TapjoyPlugin.RequestTapjoyConnect( AppConfigs.publisherIdTapjoyAndroid, AppConfigs.publisherSecretTapjoyAndroid); } else if (Application.platform == RuntimePlatform.IPhonePlayer) { Dictionary <String, String> dict = new Dictionary <String, String>(); dict.Add("TJC_OPTION_COLLECT_MAC_ADDRESS", TapjoyPlugin.MacAddressOptionOffWithVersionCheck); TapjoyPlugin.RequestTapjoyConnect( AppConfigs.publisherIdTapjoyiOS, AppConfigs.publisherSecretTapjoyiOS, dict); } }
public void Send() { Debug.Log(String.Format("C#: Sending event {0} ", myName)); TapjoyPlugin.SendEvent(myGuid); }
// FULL SCREEN ADS public void tapjoyHandleGetFullScreenAdSucceeded() { LogUtil.Log("HandleGetFullScreenAdSucceeded"); TapjoyPlugin.ShowFullScreenAd(); }
public void Show() { TapjoyPlugin.ShowEvent(this.myGuid); }
public void tapjoyShowFullscreenAd() { LogUtil.Log("tapjoyShowFullscreenAd"); TapjoyPlugin.ShowFullScreenAd(); }
public void tapjoyShowDisplayAd() { LogUtil.Log("tapjoyShowDisplayAd"); TapjoyPlugin.ShowDisplayAd(); }
// OFFERS public void tapjoyShowOffers() { LogUtil.Log("tapjoyShowOffers"); TapjoyPlugin.ShowOffers(); }
public void EnableAutoPresent(bool autoPresent) { TapjoyPlugin.EnableEventAutoPresent(myGuid, autoPresent); }
public void EnablePreload(bool preload) { TapjoyPlugin.EnableEventPreload(myGuid, preload); }
public void Show() { TapjoyPlugin.ShowEvent(myGuid); isContentAvailable = false; isContentReady = false; }
public void EventRequestCancelled() { TapjoyPlugin.EventRequestCancelled(this.eventGuid); }
public void EventRequestCompleted() { TapjoyPlugin.EventRequestCompleted(this.eventGuid); }
protected virtual void Start() { TapjoyPlugin.EnableLogging(true); TapjoyManager.offerWallOpen = false; TapjoyManager.isUserIDSet = false; }
public void HandleTapPointsEarned(int points) { TapjoyPlugin.ShowDefaultEarnedCurrencyAlert(); }