1 using System.Collections;
2 using System.Collections.Generic;
13 [Header(
"Throttle Lever Properties")]
16 public RectTransform parentRect;
17 public RectTransform handleRect;
18 private float handleSpeed = 2f;
21 #region Builtin methods
23 Debug.Log(
"#####################"+ CommonFunctions.ActiveAirplane);
28 #region Interface Methods
34 if(input && parentRect && handleRect)
36 float height = parentRect.rect.height;
37 Vector2 wantedHandlePosition =
new Vector2(0f, height * input.StickyThrottle);
38 handleRect.anchoredPosition = Vector2.Lerp(handleRect.anchoredPosition, wantedHandlePosition, Time.deltaTime * handleSpeed);