Photon Unity Networking 2  v2.1
English | 日本語 | 한국
Public Member Functions | List of all members
PhotonTransformViewPositionControl Class Reference

Public Member Functions

 PhotonTransformViewPositionControl (PhotonTransformViewPositionModel model)
 
void SetSynchronizedValues (Vector3 speed, float turnSpeed)
 These values are synchronized to the remote objects if the interpolation mode or the extrapolation mode SynchronizeValues is used. Your movement script should pass on the current speed (in units/second) and turning speed (in angles/second) so the remote object can use them to predict the objects movement. More...
 
Vector3 UpdatePosition (Vector3 currentPosition)
 Calculates the new position based on the values setup in the inspector More...
 
Vector3 GetNetworkPosition ()
 Gets the last position that was received through the network More...
 
Vector3 GetExtrapolatedPositionOffset ()
 Calculates an estimated position based on the last synchronized position, the time when the last position was received and the movement speed of the object More...
 
void OnPhotonSerializeView (Vector3 currentPosition, PhotonStream stream, PhotonMessageInfo info)
 

Member Function Documentation

Vector3 GetExtrapolatedPositionOffset ( )

Calculates an estimated position based on the last synchronized position, the time when the last position was received and the movement speed of the object

Returns
Estimated position of the remote object
Vector3 GetNetworkPosition ( )

Gets the last position that was received through the network

Returns
void SetSynchronizedValues ( Vector3  speed,
float  turnSpeed 
)

These values are synchronized to the remote objects if the interpolation mode or the extrapolation mode SynchronizeValues is used. Your movement script should pass on the current speed (in units/second) and turning speed (in angles/second) so the remote object can use them to predict the objects movement.

Parameters
speedThe current movement vector of the object in units/second.
turnSpeedThe current turn speed of the object in angles/second.
Vector3 UpdatePosition ( Vector3  currentPosition)

Calculates the new position based on the values setup in the inspector

Parameters
currentPositionThe current position.
Returns
The new position.