Пример #1
0
 void OnGUI()
 {
     if (GUI.Button(new Rect(150, 50, 500, 100), "StartLevel"))
     {
         GA.StartLevel("level1");
     }
     if (GUI.Button(new Rect(150, 200, 500, 100), "FinishLevel"))
     {
         GA.FinishLevel("level1");
     }
     if (GUI.Button(new Rect(150, 350, 500, 100), "Bonus"))
     {
         GA.Bonus(10, GA.BonusSource.Source10);
     }
     if (GUI.Button(new Rect(150, 500, 500, 100), "Pay"))
     {
         GA.Pay(19, GA.PaySource.Source10, 10);
     }
     if (GUI.Button(new Rect(150, 650, 500, 100), "Event"))
     {
         GA.Event("event1");
     }
     if (GUI.Button(new Rect(150, 800, 500, 100), "getSuperProperties"))
     {
         GA.Event("event1", "label");
     }
     if (GUI.Button(new Rect(150, 950, 500, 100), "back"))
     {
         Application.LoadLevel("AnalyticsEntry");
     }
 }
Пример #2
0
 public static void Bonus(double coin, GA.BonusSource bonusSource)
 {
             #if UNITY_IPHONE || UNITY_ANDROID
     GA.Bonus(coin, bonusSource);
             #endif
 }
Пример #3
0
 public void Bonus(string item, int number, float price, int trigger)
 {
     GA.Bonus(item, number, price, (GA.BonusSource)trigger);
 }
Пример #4
0
    void OnGUI()
    {
        int x = 150;
        int y = 50;
        int w = 500;
        int h = 100;
        int d = 150;

        if (GUI.Button(new Rect(x, y, w, h), "StartLevel1"))
        {
            GA.StartLevel("level1");
        }
        y += d;
        if (GUI.Button(new Rect(x, y, w, h), "FinishLevel"))
        {
            GA.FinishLevel("level1");
        }
        y += d;
        if (GUI.Button(new Rect(x, y, w, h), "Bonus"))
        {
            GA.Bonus(10, GA.BonusSource.Source10);
        }
        y += d;
        if (GUI.Button(new Rect(x, y, w, h), "Pay"))
        {
            GA.Pay(19, GA.PaySource.Source10, 10);
        }
        y += d;
        if (GUI.Button(new Rect(x, y, w, h), "Event"))
        {
            GA.Event("event1");
        }
        y += d;
        if (GUI.Button(new Rect(x, y, w, h), "EventLabel"))
        {
            GA.Event("event1", "label");
        }
        y += d;



        if (GUI.Button(new Rect(x, y, w, h), "EventDict"))
        {
            var dict = new Dictionary <string, string>();
            dict.Add("key", "value");

            GA.Event("event1", dict);
        }
        y += d;



        //    var obj2 = new JSONObject();
        //    obj2["key1"] = 3;
        //    obj2["key2"] = true;
        //    obj2["key3"] = 10.0f;

        //    if (GUI.Button(new Rect(x, y, w, h), "RegisterPreProperties"))
        //    {

    //        Analytics.RegisterPreProperties(obj2);
        //        Debug.Log("RegisterPreProperties");
    //    }
        //    y += d;
        //    if (GUI.Button(new Rect(x, y, w, h), "GetPreProperties"))
        //    {
        //        Debug.Log("GetPreProperties:" + Analytics.GetPreProperties().ToString());



        //    }
        //    y += d;

        //    if (GUI.Button(new Rect(x, y, w, h), "ClearPreProperties"))
    //    {

    //        Analytics.ClearPreProperties();
        //        Debug.Log("ClearPreProperties");
        //    }
        //    y += d;
        //    if (GUI.Button(new Rect(x, y, w, h), "UnregisterSuperProperty"))
        //    {
        //        Analytics.UnregisterPreProperty("key3");
        //        Debug.Log("UnregisterPreProperty");

        //    }

        //    y += d;
        //    if (GUI.Button(new Rect(x, y, w, h), "SetFirstLaunchEvent"))
        //    {
    //        Analytics.SetFirstLaunchEvent(new[] { "FirstLaunchEvent1", "FirstLaunchEvent2" });
        //        Debug.Log("SetFirstLaunchEvent");
        //    }
        //    y += d;


        //    if (GUI.Button(new Rect(x, y, w, h), "EventObject"))
        //    {
        //        var dict = new Dictionary<string, object>();
        //        dict.Add("key", 1);
        //        dict.Add("key2",true);
        //        dict.Add("key3", 2.0);

        //        Analytics.EventObject("EventObject", dict);
        //        Debug.Log("EventObject");

        //    }
    }
Пример #5
0
 public void Bonus(float price, int type)
 {
     GA.Bonus(price, (GA.BonusSource)type);
 }