Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- using UnityEngine.Video;
- public class PlayPauseButton : MonoBehaviour
- {
- PlayPauseButtonSprite ReferenceScript;
- public bool play = false;
- private VideoPlayer videoPlayer;
- void Awake()
- {
- videoPlayer = GetComponent<VideoPlayer>();
- }
- private void Start()
- {
- ReferenceScript = GetComponent<PlayPauseButtonSprite>();
- //videoPlayer.isLooping = true;
- }
- public void PlayPause()
- {
- if (videoPlayer.isPlaying)
- {
- videoPlayer.Pause();
- //ReferenceScript.Switch();
- play = true;
- Debug.Log(play);
- PauseImage();
- }
- else {
- videoPlayer.Play();
- play = false;
- Debug.Log(play);
- PlayImage();
- }
- }
- public void PlayImage()
- {
- Debug.Log("play");
- }
- public void PauseImage()
- {
- Debug.Log("pause");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement