CustomEventSample.cs 926 B

1234567891011121314151617181920212223242526272829
  1. using System;
  2. using System.Collections.Generic;
  3. namespace Unity.Services.Analytics
  4. {
  5. public static class CustomEventSample
  6. {
  7. public static void RecordCustomEventWithNoParameters()
  8. {
  9. AnalyticsService.Instance.CustomData("myEvent", new Dictionary<string, object>());
  10. }
  11. public static void RecordCustomEventWithParameters()
  12. {
  13. var parameters = new Dictionary<string, object>
  14. {
  15. { "fabulousString", "hello there" },
  16. { "sparklingInt", 1337 },
  17. { "tremendousLong", Int64.MaxValue },
  18. { "spectacularFloat", 0.451f },
  19. { "incredibleDouble", 0.000000000000000031337 },
  20. { "peculiarBool", true },
  21. { "ultimateTimestamp", DateTime.UtcNow }
  22. };
  23. AnalyticsService.Instance.CustomData("myEvent", parameters);
  24. }
  25. }
  26. }