I have one specific question regarding OnSerializeNetworkView.
if this is my function (Pseudo-code), then how do I deserialize the data if it might not be there?
void OnSerializeNetworkView(BitStream stream, NetworkMessageInfo info)
{
if (stream.isWriting && Network.isServer)
{
if (positionChanged())
{
stream.Serialize(ref transform.position.x);
stream.Serialize(ref transform.position.z);
}
}
else if(stream.isReading && Network.isClient)
{
//HOW DO I TEST FOR POSITION CHANGED HERE?
}
}
More specifically, if the data never gets sent from the server because it hasnt changed, then how do I test for differences in the clients?
Thank you for you help.
EDIT: Changed the question and narrowed the focus