123456789101112131415161718192021222324252627282930313233 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.Video;
- public class PlayeVideoModel : MonoBehaviour
- {
- public VideoPlayer videoPlayer;
- public SCButton playBtn;
- public SCButton pauseBtn;
- private void OnEnable()
- {
- videoPlayer.Play();
- }
- public void PlayVideoOnClick()
- {
- playBtn.gameObject.SetActive(false);
- pauseBtn.gameObject.SetActive(true);
- videoPlayer.Play();
- }
- public void PauseVideoOnClick()
- {
- playBtn.gameObject.SetActive(false);
- pauseBtn.gameObject.SetActive(true);
- videoPlayer.Pause();
- }
- }
|