public void PlayMovie(AvatarToPlayerNotifications playerNotification, VideoClip videoClip, MovieEnd function) { if (fadeListener == null) { fadeListener = GameObject.FindGameObjectWithTag("Listener").GetComponent <FadeListener>(); } fadeListener.SetTargetVolume(0); fadeListener.OnFadeListener(0); playerNotifications = playerNotification; listenerHandle = playerNotifications.AttachListener(transform); videoPlayer = gameObject.AddComponent <VideoPlayer>(); videoPlayer.clip = videoClip; videoPlayer.targetTexture = renderTexture; videoPlayer.Play(); Debug.Log("Play Movie:" + videoPlayer.name); endFunction = function; waitingForPlay = true; Time.timeScale = 0; fadeInFadeOut.SetToBlack(); }
public void StopMovie() { if (fadeListener == null) { fadeListener = GameObject.FindGameObjectWithTag("Listener").GetComponent <FadeListener>(); } Debug.Log("STOP MOVIE!!!!"); subtitles.OnSubtitleStop(); videoPlayer.Stop(); movieIsStarted = false; Time.timeScale = 1; endFunction(); fadeInFadeOut.SetToBlack(); fadeListener.OnFadeListener(0); fadeListener.SetTargetVolume(1.0f); Destroy(transform.root.gameObject); }
// Use this for initialization void Start() { InvokeRepeating("CheckLevel", checkTime, checkTime); fader.SetToBlack(); fader.FadeIn(checkTime); }
void Awake() { currentFov = GetComponent <Camera>().fieldOfView; fadeInOut.SetToBlack(); }