Serializing custom types for RPCs with PUN?

waxx
waxx
Hey guys, I'm looking for a way to serialize my own types with PUN. I came across this:
http://doc.exitgames.com/en/realtime/cu ... -in-photon

but it's for realtime and there doesn't seem to be Protocol class in unity plugin nor PhotonPeer. What should I use for PUN?

Comments

  • Check "Additional Types in Photon Unity Networking" section of the doc for PUN custom types info and sample.
    You may need add 'using ExitGames.Client.Photon;' directive in your code to make 'Protocol' and 'PhotonPeer' available.
  • Oh ghez, that was it! Werid, cuz I even ctrl-f'ed protocol class in PUN PDF docs and didn't find anything. Maybe I just overlooked it.

    Now another question with serialization. So it's pretty much very manualish and I gotta get dirty with byte array? That's gonna stink for classes with lots of strings for example, I understand this is the only option and I can't easily serialize using types known to Photon? :(

    Also - how to handle serializing arrays like object[]?