A class in Root.Township, Alta.Networking.
A NetworkAxisValue that syncs a rotation around one local axis, in degrees from 0 to 360, with wrap-around.
Constructors
| Member | What it is |
|---|
NetworkAxisRotation() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
1 private and internal field
| Member | What it is |
|---|
private float addRotationMultiplier | Multiplier for angles passed to RotateAngle (default 0.5). |
Properties
| Member | What it is |
|---|
protected override float CurrentValue { get; } | The target's current angle around the local axis, from its local Euler angles. |
protected override float MaximumValue { get; } | 360. |
protected override float MinimumValue { get; } | 0. |
Methods
| Member | What it is |
|---|
void RotateAngle(float angle) | Server: adds the angle (times addRotationMultiplier) to the current rotation. |
protected override void ApplyValue(float value) | Sets the target transform's local rotation to the angle around the axis. |
protected override float GetDifference(float currentValue, float value) | Absolute difference between two angles, reduced by 180 when over 180. |
protected override float LerpToValue(float value, float lerpValue) | Lerps the current angle towards a value, adjusting by 180 degrees across the wrap point. |
1 private and internal method
| Member | What it is |
|---|
private float ClampValue(float value) | Wraps an angle back into 0 to 360 (only one step, so far out values stay out). |
Used in
Members of other types that take, return or hold a NetworkAxisRotation: