Monitor and updates the Altimeter to UI
More...
Monitor and updates the Altimeter to UI
Definition at line 11 of file AC_Airplane_Altimeter.cs.
◆ HandleAirplaneUI()
void AirControl.AC_Airplane_Altimeter.HandleAirplaneUI |
( |
| ) |
|
|
inline |
Updates to UI
Implements AirControl.IAirplaneUI.
Definition at line 36 of file AC_Airplane_Altimeter.cs.
40 float currentAltitude = airplane.CurrentMSL;
41 float currentThousands = currentAltitude/1000f;
42 currentThousands = Mathf.Clamp(currentThousands,0,10);
44 float currentHundreds = currentAltitude - (Mathf.Floor(currentThousands)*1000f);
45 currentHundreds = Mathf.Clamp(currentHundreds, 0f,1000f);
50 float radialThousands = Mathf.InverseLerp(0,10,currentThousands);
51 radialThousands = 360f * radialThousands;
52 thousandsPointer.rotation = Quaternion.Euler(0f,0f,-radialThousands);
57 float radialHundreds = Mathf.InverseLerp(0f,1000f,currentHundreds);
58 radialHundreds = 360f * radialHundreds;
59 hundredspointer.rotation = Quaternion.Euler(0f,0f,-radialHundreds);
The documentation for this class was generated from the following file: