AirControl  1.3.0
Open Source, Modular, and Extensible Flight Simulator For Deep Learning Research
AC_Airplane_Propeller.cs
1 using System.Collections;
2 using System.Collections.Generic;
3 using UnityEngine;
4 
5 namespace AirControl
6 {
10  public class AC_Airplane_Propeller : MonoBehaviour
11  {
12  #region Variables
13  // Drag and drop this scrip to the propeller Gameobject in the Hierarchy
14 
15  #endregion
16 
17  #region Builtin Methods
18  // Start is called before the first frame update
19  #endregion
20 
21  #region Custom Methods
22  public void HandlePropeller(float currentRPM){
23  // get degrees per second
24  float degreesPerSecond = ((currentRPM * 360)/60)*Time.deltaTime;
25  //rotate the propeller
26  transform.Rotate(Vector3.forward, degreesPerSecond);
27  }
28 
29  #endregion
30  }
31 
32 }
AirControl
Definition: AirplaneSelector.cs:8
AirControl.AC_Airplane_Propeller
Control propeller rotation
Definition: AC_Airplane_Propeller.cs:10