예제 #1
0
    void OnGUI()
    {
        GUI.skin = this.skin;

        GUILayout.BeginArea(new Rect(Screen.width * 0.3f, Screen.height * 0.35f, Screen.width * 0.4f, Screen.height * 2.5f));

        if (GUILayout.Button("Track"))
        {
            // a simple tracking call
            Mixpanel.Track("The Button Was Clicked1");
        }

        if (GUILayout.Button("Engage")) // an engage call
        {
            Mixpanel.people.Increment("clicks", 1);
        }

        if (GUILayout.Button("Opt Out Tracking")) // an engage call
        {
            Mixpanel.OptOutTracking();
            //  EditorUtility.DisplayDialog("Opt status", "Has opted out:  " + Mixpanel.hasOptedOut() , "Ok");
        }

        if (GUILayout.Button("Opt In Tracking")) // an engage call
        {
            Mixpanel.OptInTracking();
            // var args1 = new Value();
            // args1["test"] = 100;
            // args1["me"] = 101;
            // Mixpanel.OptInTracking("newDisctinctId2", args1);
            // EditorUtility.DisplayDialog("Opt status", "Has opted out:  " + Mixpanel.hasOptedOut() , "Ok");
        }

        GUILayout.EndArea();
    }