| 12345678910111213141516171819202122232425262728293031 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.Playables;
- using UnityEngine.UI;
- public class BYQ_Slider : MonoBehaviour
- {
- public PlayableDirector m_PlayableDirector;
- public Slider m_Slider;
- public Button m_PlayBtn;
- // Start is called before the first frame update
- void Start()
- {
- m_Slider.onValueChanged.AddListener(s =>
- {
- m_PlayableDirector.time = m_PlayableDirector.duration * s;
- });
- m_PlayBtn.onClick.AddListener(() =>
- {
- m_Slider.value = 0;
- });
- }
- // Update is called once per frame
- void Update()
- {
- }
- }
|