Example #1
0
 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);
 }
Example #2
0
 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();
 }
Example #3
0
    public void tapjoyHandleTapPointsEarned(int points)
    {
        LogUtil.Log("CurrencyEarned: " + points);
        //tapPointsLabel = "Currency Earned: " + points;

        TapjoyPlugin.ShowDefaultEarnedCurrencyAlert();
    }
Example #4
0
 public void HandleGetDisplayAdSucceeded()
 {
     if (!TapjoyManager.mOpeningFullScreenAd)
     {
         TapjoyPlugin.ShowDisplayAd();
     }
 }
Example #5
0
    public void HandleTapPointsEarned(int points)
    {
        Debug.Log("C#: CurrencyEarned: " + points);
        tapPointsLabel = "Currency Earned: " + points;
        PlayerPrefs.SetInt("Vidas", PlayerPrefs.GetInt("Vidas") + points);

        TapjoyPlugin.ShowDefaultEarnedCurrencyAlert();
    }
Example #6
0
 public static void SetDisplayAdContentSize(int size)
 {
     if (Application.isEditor)
     {
         return;
     }
     TapjoyPlugin.SetDisplayAdSize((TapjoyDisplayAdSize)size);
 }
Example #7
0
 public void Send()
 {
     Debug.Log(string.Format("C#: Sending event {0} ", new object[]
     {
         this.myName
     }));
     TapjoyPlugin.SendEvent(this.myGuid);
 }
Example #8
0
    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));
    }
Example #9
0
    // DISPLAY ADS
    public void tapjoyHandleGetDisplayAdSucceeded()
    {
        LogUtil.Log("HandleGetDisplayAdSucceeded");

        if (!tapjoyOpeningFullScreenAd)
        {
            TapjoyPlugin.ShowDisplayAd();
        }
    }
Example #10
0
    public static void SetDisplayAdContentSize(int size)
    {
        if (Application.platform == RuntimePlatform.OSXEditor)
        {
            return;
        }

        TapjoyPlugin.SetDisplayAdSize((TapjoyDisplayAdSize)size);
    }
Example #11
0
    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
        }
    }
Example #12
0
    // 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();
    }
Example #13
0
 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
     }));
 }
Example #14
0
        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;
            }
        }
Example #15
0
 void OnApplicationPause(bool pause)
 {
     Debug.Log("C#: Application Pause: " + pause + " expected transition: " + shouldTransition);
     if (!shouldTransition)
     {
         if (pause)
         {
             TapjoyPlugin.AppPause();
         }
         else
         {
             TapjoyPlugin.AppResume();
         }
     }
 }
Example #16
0
    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 { }
    }
Example #17
0
    // ----------------------------------------------------------------------
    // 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);
        }
    }
Example #18
0
    public void Send()
    {
        Debug.Log(String.Format("C#: Sending event {0} ", myName));

        TapjoyPlugin.SendEvent(myGuid);
    }
Example #19
0
    // FULL SCREEN ADS
    public void tapjoyHandleGetFullScreenAdSucceeded()
    {
        LogUtil.Log("HandleGetFullScreenAdSucceeded");

        TapjoyPlugin.ShowFullScreenAd();
    }
Example #20
0
 public void Show()
 {
     TapjoyPlugin.ShowEvent(this.myGuid);
 }
Example #21
0
 public void tapjoyShowFullscreenAd()
 {
     LogUtil.Log("tapjoyShowFullscreenAd");
     TapjoyPlugin.ShowFullScreenAd();
 }
Example #22
0
 public void tapjoyShowDisplayAd()
 {
     LogUtil.Log("tapjoyShowDisplayAd");
     TapjoyPlugin.ShowDisplayAd();
 }
Example #23
0
    // OFFERS

    public void tapjoyShowOffers()
    {
        LogUtil.Log("tapjoyShowOffers");
        TapjoyPlugin.ShowOffers();
    }
Example #24
0
 public void EnableAutoPresent(bool autoPresent)
 {
     TapjoyPlugin.EnableEventAutoPresent(myGuid, autoPresent);
 }
Example #25
0
 public void EnablePreload(bool preload)
 {
     TapjoyPlugin.EnableEventPreload(myGuid, preload);
 }
Example #26
0
 public void Show()
 {
     TapjoyPlugin.ShowEvent(myGuid);
     isContentAvailable = false;
     isContentReady     = false;
 }
Example #27
0
 public void EventRequestCancelled()
 {
     TapjoyPlugin.EventRequestCancelled(this.eventGuid);
 }
Example #28
0
 public void EventRequestCompleted()
 {
     TapjoyPlugin.EventRequestCompleted(this.eventGuid);
 }
Example #29
0
 protected virtual void Start()
 {
     TapjoyPlugin.EnableLogging(true);
     TapjoyManager.offerWallOpen = false;
     TapjoyManager.isUserIDSet   = false;
 }
Example #30
0
 public void HandleTapPointsEarned(int points)
 {
     TapjoyPlugin.ShowDefaultEarnedCurrencyAlert();
 }