Inheritance: UnityEngine.MonoBehaviour, IBoolEmitter
Beispiel #1
0
        public void PlayMovie(bool play = true)
        {
            //	Debug.Log ("PlayMovie - setting play of " + name + " to " + (play ? "TRUE" : "FALSE"));
                        if (play) {
                                if (PlayingVideo != null)
                                        PlayingVideo.PlayMovie (false);
                                GetComponent<Renderer>().enabled = true;
                                MovieGameObject.GetComponent<Renderer>().material.mainTexture = Movie;

                                Movie.Play ();
                                GetComponent<AudioSource>().clip = Movie.audioClip;
                                GetComponent<AudioSource>().Play ();
                                PlayingVideo = this;
                        } else {
                                GetComponent<Renderer>().enabled = false;
                                try {
                                        Movie.Stop ();
                                        GetComponent<AudioSource>().Stop ();
                                } catch (System.NullReferenceException ex) {
                                        Debug.LogError ("Missing Video Exception: " + ex);
                                }
                        }
        }