UISliderMoveButton.cs 483 B

1234567891011121314151617181920
  1. using System;
  2. using UnityEngine;
  3. using UnityEngine.EventSystems;
  4. using UnityEngine.UI;
  5. public class UISliderMoveButton : MonoBehaviour, IDragHandler, IEventSystemHandler
  6. {
  7. public void OnDrag(PointerEventData eventData)
  8. {
  9. this.m_Slider.normalizedValue += this.m_Power * Time.deltaTime;
  10. }
  11. [SerializeField]
  12. [Tooltip("影響を与えるスライダー")]
  13. private Slider m_Slider;
  14. [SerializeField]
  15. [Tooltip("1秒あたりの変化量")]
  16. private float m_Power = 0.1f;
  17. }