29 lines
664 B
C#
29 lines
664 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
using UnityEngine.UI;
|
|
|
|
public class SliderReleaseHandler : MonoBehaviour, IPointerUpHandler, IDragHandler
|
|
{
|
|
public RewindManager rewindManager;
|
|
private Slider _slider;
|
|
private float _lastDragValue;
|
|
|
|
void Awake()
|
|
{
|
|
_slider = GetComponent<Slider>();
|
|
_lastDragValue = _slider.value;
|
|
}
|
|
|
|
public void OnDrag(PointerEventData eventData)
|
|
{
|
|
_lastDragValue = _slider.value;
|
|
}
|
|
|
|
public void OnPointerUp(PointerEventData eventData)
|
|
{
|
|
rewindManager.OnSliderReleased(_lastDragValue);
|
|
}
|
|
}
|