1 using System.Collections;
2 using System.Collections.Generic;
13 [Header(
"Flap Lever Properties")]
16 public RectTransform parentRect;
17 public RectTransform handleRect;
18 private float handleSpeed = 2f;
21 #region Builtin methods
27 #region Interface Methods
33 if(input && parentRect && handleRect)
35 float height = parentRect.rect.height;
36 Vector2 wantedHandlePosition =
new Vector2(0f, -height * input.NormalizedFlaps);
37 handleRect.anchoredPosition = Vector2.Lerp(handleRect.anchoredPosition, wantedHandlePosition, Time.deltaTime * handleSpeed);