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
26 #region Interface Methods
32 if(input && parentRect && handleRect)
34 float height = parentRect.rect.height;
35 Vector2 wantedHandlePosition =
new Vector2(0f, height/2 * input.Pitch);
36 handleRect.anchoredPosition = Vector2.Lerp(handleRect.anchoredPosition, wantedHandlePosition, Time.deltaTime * handleSpeed);