Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

InvalidData

Discussion in 'Unity Analytics' started by eezSZI, Oct 23, 2015.

  1. eezSZI

    eezSZI

    Joined:
    Nov 16, 2012
    Posts:
    121
    This seems simple enough (maybe I'm missing something obvious), I'm sending an enum and an int (returned from function call). Is there something wrong with this? It always returns a result of "InvalidData"

    skillCorrect is an enum value (checked logs and looks valid), GetDifficultly returns an int, again logs returned a valid value.

    Code (csharp):
    1. CustomEvent("skill-correct", new Dictionary<string, object>{{"skill-type", skillCorrect}, {"difficulty", GetDifficulty(skillCorrect)}})
     
    Last edited: Oct 23, 2015
  2. eezSZI

    eezSZI

    Joined:
    Nov 16, 2012
    Posts:
    121
    We have other projects that pass enums, I thought it converted the parameter to a string by default. I'll try converting it to a string.

    EDIT: That seems to be working. From now on we'll convert enums ToString().
     
    Last edited: Oct 23, 2015
  3. marc_tanenbaum

    marc_tanenbaum

    Unity Technologies

    Joined:
    Oct 22, 2014
    Posts:
    637
    Thanks for proactively solving your own issue! :)

    Our system only supports strings, bools and numbers. We're contemplating a couple API changes, and one of the ones I'll push for is an implicit conversion of Enums.
     
    Last edited: Oct 23, 2015
  4. eezSZI

    eezSZI

    Joined:
    Nov 16, 2012
    Posts:
    121
    Haha, for sure!

    Yeah I must have been mistaken that it worked in the past. We have a facade for analytics so we are now converting any missed Enums before we send events out.
     
    marc_tanenbaum likes this.
  5. marc_tanenbaum

    marc_tanenbaum

    Unity Technologies

    Joined:
    Oct 22, 2014
    Posts:
    637
    That's a good idea (I'm a huge fan of building facades/interfaces that insulate me from the downstream effects of other teams/companies).

    I've asked our scheduling guy to allow us a bit of time for this fix, since it's super easy and very sensible.
     
    eezSZI likes this.