custom types - register

Hi! I'm trying to understand how to use register function in custom types class. I want to send my own type of object; so I created methods for serializing and deserializing it like in CustomTypes.cs . For now I'm using these functions every time when I wanted to send them like serialize(...) and deserialize(...); so I want to know what the register does? Where to use it? How to use it ? Can I make photon to be able serialize/deserialize it without saying serialize(...) every time in my code.

Thanks a lot =)

Comments

  • After you registered your serialize and deserialize methods, you can send the objects by just passing their reference. You can use it in RPCs or put it into the stream in OnPhotonSerializeView.
  • Well, How do I register them!=) Just by calling the register function in my code? I couldn't do the register part.
  • Ah. It sounded different :)
    Yes, call TryRegister. Same as we do in CustomTypes.cs: register before use and you're fine.
Sign In or Register to comment.