Class AnalogGauge
Analog gauge that displays a value by rotating a needle GameObject, like a speedometer or tachometer. Requires a child GameObject named "Needle".
Namespace: NWH.VehiclePhysics2.VehicleGUI
Assembly: NWH.VehiclePhysics2.dll
Syntax
public class AnalogGauge : MonoBehaviour
Fields
endAngle
Angle of the needle (in degrees, Z-axis rotation) at the maximum value. Use lockAtEnd in play mode to visually position and determine the correct angle.
Declaration
[Tooltip("angle of the needle at the highest value. You can use lock at end option to adjust this value while in play mode.")]
public float endAngle
Field Value
| Type | Description |
|---|---|
| float |
lockAtEnd
Pins the needle at endAngle for calibration. Play mode only.
Declaration
[Tooltip("Locks the needle position at the end angle (play mode only).")]
public bool lockAtEnd
Field Value
| Type | Description |
|---|---|
| bool |
lockAtStart
Pins the needle at startAngle for calibration. Play mode only.
Declaration
[Tooltip("Locks the needle position at the start angle (play mode only).")]
public bool lockAtStart
Field Value
| Type | Description |
|---|---|
| bool |
maxValue
Value at the end of needle travel. Value is clamped to it.
Declaration
[Tooltip("Value at the end of needle travel, at the end angle.")]
public float maxValue
Field Value
| Type | Description |
|---|---|
| float |
needleSmoothing
Needle smoothing. 0 is instant, 1 is the slowest the needle can move.
Declaration
[Range(0, 1)]
[Tooltip(" Smooths the travel of the needle making it more inert, as if actually had some mass and resistance.")]
public float needleSmoothing
Field Value
| Type | Description |
|---|---|
| float |
startAngle
Angle of the needle (in degrees, Z-axis rotation) at the minimum value (typically zero). Use lockAtStart in play mode to visually position and determine the correct angle.
Declaration
[Tooltip("angle of the needle at the lowest value. You can use lock at start option to adjust this value while in play mode.")]
public float startAngle
Field Value
| Type | Description |
|---|---|
| float |
Properties
Value
Displayed value, clamped to 0..maxValue.
Declaration
public float Value { get; set; }
Property Value
| Type | Description |
|---|---|
| float |