Skip to content

Instantly share code, notes, and snippets.

@atakotestudios
Last active May 21, 2017 03:54
Show Gist options
  • Save atakotestudios/a5020ea72983ead218fc0818c9a507d7 to your computer and use it in GitHub Desktop.
Save atakotestudios/a5020ea72983ead218fc0818c9a507d7 to your computer and use it in GitHub Desktop.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Video;
using UnityEngine.UI;
public class PlayMovieOnSpace : MonoBehaviour {
private VideoPlayer videoPlayer;
void Start(){
videoPlayer = gameObject.GetComponent<VideoPlayer> ();
}
void Update () {
if (Input.GetButtonDown ("Jump")) {
if (videoPlayer.isPlaying) {
videoPlayer.Pause();
}
else {
videoPlayer.Play();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment