Photon.Pun.PhotonRigidbody2DView Class Reference
Inheritance diagram for Photon.Pun.PhotonRigidbody2DView:
Photon.Pun.MonoBehaviourPun Photon.Pun.IPunObservable

Public Member Functions

void Awake ()
 
void FixedUpdate ()
 
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_SynchronizeVelocity = true
 
bool m_SynchronizeAngularVelocity = false
 
bool m_TeleportEnabled = false
 
float m_TeleportIfDistanceGreaterThan = 3.0f
 

Additional Inherited Members

- Properties inherited from Photon.Pun.MonoBehaviourPun
PhotonView photonView [get]
 A cached reference to a PhotonView on this GameObject. More...
 

Member Function Documentation

◆ Awake()

void Photon.Pun.PhotonRigidbody2DView.Awake ( )

◆ FixedUpdate()

void Photon.Pun.PhotonRigidbody2DView.FixedUpdate ( )

◆ OnPhotonSerializeView()

void Photon.Pun.PhotonRigidbody2DView.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.

Member Data Documentation

◆ m_SynchronizeAngularVelocity

bool Photon.Pun.PhotonRigidbody2DView.m_SynchronizeAngularVelocity = false

◆ m_SynchronizeVelocity

bool Photon.Pun.PhotonRigidbody2DView.m_SynchronizeVelocity = true

◆ m_TeleportEnabled

bool Photon.Pun.PhotonRigidbody2DView.m_TeleportEnabled = false

◆ m_TeleportIfDistanceGreaterThan

float Photon.Pun.PhotonRigidbody2DView.m_TeleportIfDistanceGreaterThan = 3.0f

The documentation for this class was generated from the following file: