Which types can be used with player custom properties?
Options
Hi,
I tried adding a value of type
I'm a bit confused about this error (why OurEnumType would be the problem?), but I'm guessing that what it really means is that it can't serialize the Dictionary - is this the case?
Please could you let me know what types can/cannot be added to custom properties? (or perhaps this is documented somewhere).
Thank you!
S
I tried adding a value of type
Dictionary<OurEnumType, OurOtherType>
to the player custom properties, but got the error Exception: Unexpected - cannot serialize Dictionary with value type: OurEnumType
I'm a bit confused about this error (why OurEnumType would be the problem?), but I'm guessing that what it really means is that it can't serialize the Dictionary - is this the case?
Please could you let me know what types can/cannot be added to custom properties? (or perhaps this is documented somewhere).
Thank you!
S
0
Answers
-
Hi @sosh,
The information you are looking for is available in this documentation page.
We will make it available for PUN docs as well soon.0 -
Thanks JohnTube.
Hmm, looks like Dictionary is supported. Any idea why it's not serializing mine?
(I'll post another question for this later)0 -
Please convert
enum
values tobyte
orint
. Photon can't handle custom default by default.
The issue is not in Dictionary itself but inOurEnumType
.0 -
Thanks! One question then - if I used PhotonPeer.RegisterType to register OurEnumType, would it then work (as the key of the dictionary)?0