using UnityEngine; using UnityEngine.EventSystems; namespace AIGame.Review { public sealed class BotAnimationSeekBar : MonoBehaviour, IPointerDownHandler, IDragHandler { public BotAnimationLab viewer; public void OnPointerDown(PointerEventData e) => Seek(e); public void OnDrag(PointerEventData e) => Seek(e); void Seek(PointerEventData e) { var rect = (RectTransform)transform; if (viewer && RectTransformUtility.ScreenPointToLocalPointInRectangle(rect, e.position, e.pressEventCamera, out var p)) viewer.Seek(Mathf.InverseLerp(rect.rect.xMin, rect.rect.xMax, p.x)); } } }