AirControl  1.3.0
Open Source, Modular, and Extensible Flight Simulator For Deep Learning Research
AirControl.AC_Airplane_YawLever Class Reference

Monitor and updates the Yaw lever to UI More...

Inheritance diagram for AirControl.AC_Airplane_YawLever:
Collaboration diagram for AirControl.AC_Airplane_YawLever:

Public Member Functions

void HandleAirplaneUI ()
 Updates to UI More...
 

Public Attributes

RectTransform parentRect
 
RectTransform handleRect
 

Detailed Description

Monitor and updates the Yaw lever to UI

Definition at line 10 of file AC_Airplane_YawLever.cs.

Member Function Documentation

◆ HandleAirplaneUI()

void AirControl.AC_Airplane_YawLever.HandleAirplaneUI ( )
inline

Updates to UI

Implements AirControl.IAirplaneUI.

Definition at line 29 of file AC_Airplane_YawLever.cs.

30  {
31  if(input && parentRect && handleRect)
32  {
33  float height = parentRect.rect.height;
34  Vector2 wantedHandlePosition = new Vector2(0f, height/2 * input.Yaw);
35  handleRect.anchoredPosition = Vector2.Lerp(handleRect.anchoredPosition, wantedHandlePosition, Time.deltaTime * handleSpeed);
36  }
37  }

The documentation for this class was generated from the following file: