
Public Member Functions | |
void | Awake () |
void | Update () |
void | OnPhotonSerializeView (PhotonStream stream, PhotonMessageInfo info) |
Called by PUN several times per second, so that your script can write and read synchronization data for the PhotonView. More... | |
Public Attributes | |
bool | m_SynchronizePosition = true |
bool | m_SynchronizeRotation = true |
bool | m_SynchronizeScale = false |
bool | m_UseLocal |
Additional Inherited Members | |
![]() | |
PhotonView | photonView [get] |
A cached reference to a PhotonView on this GameObject. More... | |
Member Function Documentation
◆ Awake()
void Photon.Pun.PhotonTransformView.Awake | ( | ) |
◆ OnPhotonSerializeView()
void Photon.Pun.PhotonTransformView.OnPhotonSerializeView | ( | PhotonStream | stream, |
PhotonMessageInfo | info | ||
) |
Called by PUN several times per second, so that your script can write and read synchronization data for the PhotonView.
This method will be called in scripts that are assigned as Observed component of a PhotonView.
PhotonNetwork.SerializationRate affects how often this method is called.
PhotonNetwork.SendRate affects how often packages are sent by this client.
Implementing this method, you can customize which data a PhotonView regularly synchronizes. Your code defines what is being sent (content) and how your data is used by receiving clients.
Unlike other callbacks, OnPhotonSerializeView only gets called when it is assigned to a PhotonView as PhotonView.observed script.
To make use of this method, the PhotonStream is essential. It will be in "writing" mode" on the client that controls a PhotonView (PhotonStream.IsWriting == true) and in "reading mode" on the remote clients that just receive that the controlling client sends.
If you skip writing any value into the stream, PUN will skip the update. Used carefully, this can conserve bandwidth and messages (which have a limit per room/second).
Note that OnPhotonSerializeView is not called on remote clients when the sender does not send any update. This can't be used as "x-times per second Update()".
Implements Photon.Pun.IPunObservable.
◆ Update()
void Photon.Pun.PhotonTransformView.Update | ( | ) |
Member Data Documentation
◆ m_SynchronizePosition
bool Photon.Pun.PhotonTransformView.m_SynchronizePosition = true |
◆ m_SynchronizeRotation
bool Photon.Pun.PhotonTransformView.m_SynchronizeRotation = true |
◆ m_SynchronizeScale
bool Photon.Pun.PhotonTransformView.m_SynchronizeScale = false |
◆ m_UseLocal
bool Photon.Pun.PhotonTransformView.m_UseLocal |
The documentation for this class was generated from the following file:
- 3rd-Party/Photon/PhotonUnityNetworking/Code/Views/PhotonTransformView.cs