Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Unsupported enum type 'UnityEngine.Networking.Types.NetworkID'

Discussion in 'Connected Games' started by Chris_Entropy, Oct 6, 2015.

  1. Chris_Entropy

    Chris_Entropy

    Joined:
    Apr 11, 2011
    Posts:
    166
    Every time I use the NetworkID enum type in any C# script (namespace UnityEngine.Networking.Types), my console is flooded with the following error:
    Unsupported enum type 'UnityEngine.Networking.Types.NetworkID' used for field '<variable name>' in class '<class name>'

    It does not seem to interfere with any functionality, but it clutters the console. Is there a way around it?
     
  2. seanr

    seanr

    Unity Technologies

    Joined:
    Sep 22, 2014
    Posts:
    669
    this is a known bug.. 711764
     
  3. Chris_Entropy

    Chris_Entropy

    Joined:
    Apr 11, 2011
    Posts:
    166
    Can it be workarounded by storing the value in a ulong? Or will this cause some information to go missing?
     
  4. JeremyUnity

    JeremyUnity

    Unity Technologies

    Joined:
    Mar 4, 2014
    Posts:
    147
    That's the best work around right now. The issue is Unity's enum serializer expects a 32bit value only, but the underlying type for NetworkID is a ulong
     
  5. Chris_Entropy

    Chris_Entropy

    Joined:
    Apr 11, 2011
    Posts:
    166
    Ok, thanks.
     
  6. mikef

    mikef

    Joined:
    Apr 2, 2009
    Posts:
    55
    Hi, i've just run into this issue, how do you go about converting the value to a ulong so as to avoid these errors?
     
  7. asperatology

    asperatology

    Joined:
    Mar 10, 2015
    Posts:
    966
    ulong value = (ulong) intValue?

    Typecasting?
     
  8. Chris_Entropy

    Chris_Entropy

    Joined:
    Apr 11, 2011
    Posts:
    166
    I store it in a variable of type ulong instead of a NetworkID.

    so for example:
    ulong networkIdUlong = (ulong) actualNetworkId;

    Since I only need it for comparison, I never make a cast back to NetworkID, I don't know if this would work without error. But the errors seem to be irrelevant anyway, since there do not seem to be any bugs in the actual game.
     
  9. mikef

    mikef

    Joined:
    Apr 2, 2009
    Posts:
    55
    Thanks Chris, much appreciated!
     
  10. AllFatherGray

    AllFatherGray

    Joined:
    Nov 29, 2014
    Posts:
    8
    Any ETA on when 64 bit support will be added? I'd like to be able to back my enums with long/ulongs.