|
Network Library Documentation
|
Handles synchronization of position and rotation over the network. For local users sends updates in time interval, for remote users interpolates transform. More...
Public Member Functions | |
| void | ApplyNetworkTransform (Vector3 pos, Quaternion rot) |
| Applies the received position and rotation from the network to be used for interpolation. | |
Public Attributes | |
| float | sendRate = 0.05f |
| Time interval between transform updates for local users. | |
| NetworkUser | UserInfo |
| UserInfo class used for checking if the object belongs to the local user or another player. | |
Private Member Functions | |
| void | Start () |
| Initializes the transform targets and adjusts send rate based on UDP setting. | |
| void | Update () |
| For local users, sends transform updates periodically. For remote users, smoothly interpolates transform to the target. | |
Private Attributes | |
| float | sendTimer = 0f |
| Timer to track when the next transform should be sent. | |
| Vector3 | targetPosition |
| Target position to interpolate to (for remote users). | |
| Quaternion | targetRotation |
| Target rotation to interpolate to (for remote users). | |
Handles synchronization of position and rotation over the network. For local users sends updates in time interval, for remote users interpolates transform.
Definition at line 6 of file NetworkTransform.cs.
| void NetworkTransform.ApplyNetworkTransform | ( | Vector3 | pos, |
| Quaternion | rot ) |
Applies the received position and rotation from the network to be used for interpolation.
Definition at line 64 of file NetworkTransform.cs.
|
private |
Initializes the transform targets and adjusts send rate based on UDP setting.
Definition at line 31 of file NetworkTransform.cs.
|
private |
For local users, sends transform updates periodically. For remote users, smoothly interpolates transform to the target.
Definition at line 44 of file NetworkTransform.cs.
| float NetworkTransform.sendRate = 0.05f |
Time interval between transform updates for local users.
Definition at line 11 of file NetworkTransform.cs.
|
private |
Timer to track when the next transform should be sent.
Definition at line 15 of file NetworkTransform.cs.
|
private |
Target position to interpolate to (for remote users).
Definition at line 19 of file NetworkTransform.cs.
|
private |
Target rotation to interpolate to (for remote users).
Definition at line 23 of file NetworkTransform.cs.
| NetworkUser NetworkTransform.UserInfo |
UserInfo class used for checking if the object belongs to the local user or another player.
Definition at line 27 of file NetworkTransform.cs.