The PhotonStreamQueue helps you poll object states at higher frequencies then 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...
The PhotonStreamQueue helps you poll object states at higher frequencies then 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.
◆ PhotonStreamQueue()
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 |
◆ Deserialize()
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 PhotonStreamQueue.HasQueuedObjects |
( |
| ) |
|
Determines whether the queue has stored any objects
◆ ReceiveNext()
object PhotonStreamQueue.ReceiveNext |
( |
| ) |
|
◆ Reset()
void PhotonStreamQueue.Reset |
( |
| ) |
|
Resets the PhotonStreamQueue. You need to do this whenever the amount of objects you are observing changes
◆ SendNext()
void 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()
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 |