Esempio n. 1
0
    /// <summary>
    /// Draw GUI controls and call analytics service.
    /// </summary>
    private void OnGUI()
    {
        int        offset  = 0;
        IAnalytics service = Flurry.Instance;

        if (Button("Log User Name", offset++))
        {
            service.LogUserID("Github User");
        }

        if (Button("Log User Age", offset++))
        {
            service.LogUserAge(24);
        }

        if (Button("Log User Gender", offset++))
        {
            service.LogUserGender(UserGender.Male);
        }

        if (Button("Log User Location", offset++))
        {
            //TODO: impl
        }

        if (Button("Log Event", offset++))
        {
            service.LogEvent("event", new Dictionary <string, string>
            {
#if UNITY_5
                { "AppVersion", Application.version },
#endif
                { "UnityVersion", Application.unityVersion }
            });
        }

        if (Button("Begin Timed Event", offset++))
        {
            service.BeginLogEvent("timed-event");
        }

        if (Button("End Timed Event", offset++))
        {
            service.EndLogEvent("timed-event");
        }

        if (Button("Log Page View", offset++))
        {
            //TODO: impl
        }

        if (Button("Log Error", offset))
        {
            service.LogError("test-script-error", "Test Error", this);
        }
    }
    /// <summary>
    /// Draw GUI controls and call analytics service.
    /// </summary>
    private void OnGUI()
    {
        int        offset  = 0;
        IAnalytics service = Flurry.Instance;

        if (Button("Log User Name", offset++))
        {
            service.LogUserID("Github User");
        }

        if (Button("Log User Age", offset++))
        {
            service.LogUserAge(24);
        }

        if (Button("Log User Gender", offset++))
        {
            service.LogUserGender(UserGender.Male);
        }

        if (Button("Log User Location", offset++))
        {
            //TODO: impl
        }

        if (Button("Log Event", offset++))
        {
            service.LogEvent("event");
        }

        if (Button("Begin Timed Event", offset++))
        {
            service.BeginLogEvent("timed-event");
        }

        if (Button("End Timed Event", offset++))
        {
            service.EndLogEvent("timed-event");
        }

        if (Button("Log Page View", offset++))
        {
            //TODO: impl
        }

        if (Button("Log Error", offset++))
        {
            service.LogError("test-script-error", "Test Error");
        }
    }
 public void BeginUserEvent(string userEvent)
 {
     service.BeginLogEvent(userEvent);
 }