void KickoutListenerFromCameraAnimation() { Debug.Log("Removing listener from scene component: " + name); DebugUtilities.Assert(actingInScene != null, "Must have a acting scene"); DebugUtilities.Assert(actingInScene.GetPlayerNotifications() != null, "Must have a player notifications"); actingInScene.GetPlayerNotifications().DetachListener(listenerHandle); listenerHandle = null; }
public void StopMovie() { if (fadeListener == null) { fadeListener = GameObject.FindGameObjectWithTag("Listener").GetComponent <FadeListener>(); } fadeListener.OnFadeListener(0); Debug.Log("STOP MOVIE!!!!"); videoPlayer.Stop(); GetComponent <AudioSource>().Stop(); movieIsStarted = false; Time.timeScale = 1; endFunction(); fadeInFadeOut.SetToBlack(); playerNotifications.DetachListener(listenerHandle); listenerHandle = null; Destroy(transform.root.gameObject); }
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 DetachListener(PlayerInteraction.ListenerStackItem item) { player.playerInteraction.DetachListener(item); }
void ChildListenerToCameraAnimation() { listenerHandle = actingInScene.GetPlayerNotifications().AttachListener(Camera.main.transform); }