void OnSerializeNetworkView(BitStream stream, NetworkMessageInfo info) { int net_kart = 0; int net_currentSelectedKart = 0; int net_gender = 0; int net_position = 0; int net_queueNumber = 0; bool net_kartSelected = false; bool net_loadingFinished = false; if (stream.isWriting) { net_kart = (int)kart; net_currentSelectedKart = (int)currentSelectedKart; net_gender = (int)gender; net_position = position; net_queueNumber = queueNumber; net_kartSelected = kartSelected; net_loadingFinished = loadingFinished; stream.Serialize(ref net_kart); stream.Serialize(ref net_currentSelectedKart); stream.Serialize(ref net_gender); stream.Serialize(ref net_position); stream.Serialize(ref net_kartSelected); stream.Serialize(ref net_loadingFinished); stream.Serialize(ref net_queueNumber); } else if (stream.isReading) { stream.Serialize(ref net_kart); stream.Serialize(ref net_currentSelectedKart); stream.Serialize(ref net_gender); stream.Serialize(ref net_position); stream.Serialize(ref net_kartSelected); stream.Serialize(ref net_loadingFinished); stream.Serialize(ref net_queueNumber); kart = (KartEnum)net_kart; currentSelectedKart = (KartEnum)net_currentSelectedKart; gender = (Gender)net_gender; position = net_position; queueNumber = net_queueNumber; kartSelected = net_kartSelected; loadingFinished = net_loadingFinished; } }