I am trying to make a set of controls (pause/play) for a video in unity world space, with this much so far…
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
[RequireComponent (typeof(AudioSource))]
public class playVideo : MonoBehaviour {
public MovieTexture movie;
public AudioSource audio;
public bool playVid = true;
// Use this for initialization
void Start () {
{
GetComponent<RawImage> ().texture = movie as MovieTexture;
audio = GetComponent<AudioSource> ();
audio.clip = movie.audioClip;
movie.Pause ();
audio.Pause ();
}
public void playIt(){
if (playVid = false)
{
movie.Pause ();
audio.Pause ();
}
else if (playVid = true)
{
movie.Play ();
audio.Play ();
}
}
}
but I can’t get a button click to change the bool state, any ideas?
Thanks for the help !