1 using System.Collections;
2 using System.Collections.Generic;
15 [Header(
"Airspeed Indicator Properties")]
18 public RectTransform pointer;
19 public float maxIndicatedKnots = 200f;
24 public const float mphToKnts = 0.868976f;
26 #region Builtin methods
32 #region Interface Methods
38 if(characteristics && pointer)
40 currentKnots = characteristics.MPH * mphToKnts;
43 float normalizedKnots = Mathf.InverseLerp(0f, maxIndicatedKnots, currentKnots);
44 float wantedRotation = 360f * normalizedKnots;
45 pointer.rotation = Quaternion.Euler(0f, 0f, -wantedRotation);
49 StaticOutputSchema.CurrentSpeed = currentKnots;