The PhotonStreamQueue helps you poll object states at higher frequencies than what PhotonNetwork.SendRate dictates and then sends all those states at once when Serialize() is called. On the receiving end you can call Deserialize() and then the stream will roll out the received object states in the same order and timeStep they were recorded in. More...
Public Member Functions | |
PhotonStreamQueue (int sampleRate) | |
Initializes a new instance of the PhotonStreamQueue class. More... | |
void | Reset () |
Resets the PhotonStreamQueue. You need to do this whenever the amount of objects you are observing changes More... | |
void | SendNext (object obj) |
Adds the next object to the queue. This works just like PhotonStream.SendNext More... | |
bool | HasQueuedObjects () |
Determines whether the queue has stored any objects More... | |
object | ReceiveNext () |
Receives the next object from the queue. This works just like PhotonStream.ReceiveNext More... | |
void | Serialize (PhotonStream stream) |
Serializes the specified stream. Call this in your OnPhotonSerializeView method to send the whole recorded stream. More... | |
void | Deserialize (PhotonStream stream) |
Deserializes the specified stream. Call this in your OnPhotonSerializeView method to receive the whole recorded stream. More... | |
Detailed Description
The PhotonStreamQueue helps you poll object states at higher frequencies than what PhotonNetwork.SendRate dictates and then sends all those states at once when Serialize() is called. On the receiving end you can call Deserialize() and then the stream will roll out the received object states in the same order and timeStep they were recorded in.
Constructor & Destructor Documentation
◆ PhotonStreamQueue()
Photon.Pun.PhotonStreamQueue.PhotonStreamQueue | ( | int | sampleRate | ) |
Initializes a new instance of the PhotonStreamQueue class.
- Parameters
-
sampleRate How many times per second should the object states be sampled
Member Function Documentation
◆ Deserialize()
void Photon.Pun.PhotonStreamQueue.Deserialize | ( | PhotonStream | stream | ) |
Deserializes the specified stream. Call this in your OnPhotonSerializeView method to receive the whole recorded stream.
- Parameters
-
stream The PhotonStream you receive as a parameter in OnPhotonSerializeView
◆ HasQueuedObjects()
bool Photon.Pun.PhotonStreamQueue.HasQueuedObjects | ( | ) |
Determines whether the queue has stored any objects
◆ ReceiveNext()
object Photon.Pun.PhotonStreamQueue.ReceiveNext | ( | ) |
Receives the next object from the queue. This works just like PhotonStream.ReceiveNext
- Returns
◆ Reset()
void Photon.Pun.PhotonStreamQueue.Reset | ( | ) |
Resets the PhotonStreamQueue. You need to do this whenever the amount of objects you are observing changes
◆ SendNext()
void Photon.Pun.PhotonStreamQueue.SendNext | ( | object | obj | ) |
Adds the next object to the queue. This works just like PhotonStream.SendNext
- Parameters
-
obj The object you want to add to the queue
◆ Serialize()
void Photon.Pun.PhotonStreamQueue.Serialize | ( | PhotonStream | stream | ) |
Serializes the specified stream. Call this in your OnPhotonSerializeView method to send the whole recorded stream.
- Parameters
-
stream The PhotonStream you receive as a parameter in OnPhotonSerializeView
The documentation for this class was generated from the following file:
- 3rd-Party/Photon/PhotonUnityNetworking/Code/PhotonStreamQueue.cs