コード例 #1
0
 void Prepared(UnityEngine.Video.VideoPlayer vp)
 {
     if (sizeIndex == 0 && !videoPlayer.isPlaying)
     {
         VideoPlay();
     }
 }
コード例 #2
0
        public override void Initialize(MediaPlayerController controller, Transform target)
        {
            m_controller = controller;

            if (target == null)
            {
                Debug.LogWarning("[VideoPlayer360][Warning] The 'target' property is required.");
                return;
            }

            m_target = target;

            videoPlayer                        = target.gameObject.AddComponent <VideoPlayer>(); // Normally I would check to see if the component already existed, but for some reason GetComponent<VideoPlayer>() doesn't return null even if there isn't a component
            videoPlayer.renderMode             = VideoRenderMode.MaterialOverride;
            videoPlayer.targetMaterialRenderer = target.GetComponent <MeshRenderer>();

            var audioSource = videoPlayer.gameObject.AddComponent <AudioSource>();

            videoPlayer.audioOutputMode = VideoAudioOutputMode.AudioSource;
            videoPlayer.SetTargetAudioSource(0, audioSource);

            videoPlayer.skipOnDrop = true;

            videoPlayer.isLooping         = true;
            videoPlayer.prepareCompleted += (e) => { OnVideoReady(); };
            videoPlayer.loopPointReached += (e) => { OnVideoEnd(); };
            videoPlayer.seekCompleted    += (e) => { OnSeekComplete(); };
        }
コード例 #3
0
 private void loopPointReached(UnityEngine.Video.VideoPlayer vp)
 {
     if (m_playComplete != null)
     {
         m_playComplete();
     }
 }
コード例 #4
0
ファイル: AnimalView.cs プロジェクト: ro-anders/zoo-adventure
 private void OnVideoDone(UnityEngine.Video.VideoPlayer vp)
 {
     UnityEngine.Debug.Log(activeAnimal.ResourceName + " clip done playing");
     // Remove the video and start the sound playing
     this.DismissVideo();
     this.PlayAudio();
 }
コード例 #5
0
    //void SplashTransition()
    //{
    //    if (state_index < states_array.Length)
    //    {
    //        Color solid_colour = states_array[state_index].colour;
    //        Color faded_colour = solid_colour;
    //        faded_colour.a = 0;

    //        splash_screen.sprite = states_array[state_index].image;

    //        if (phase_index < 3)
    //        {
    //            state_timer += Time.deltaTime;

    //            switch (phase_index)
    //            {
    //                case 0:
    //                    {
    //                        float t = state_timer / states_array[state_index].lerp;
    //                        splash_screen.color = Color.Lerp(faded_colour, solid_colour, t);

    //                        if (state_timer > states_array[state_index].lerp)
    //                        {
    //                            state_timer -= states_array[state_index].lerp;
    //                            ++phase_index;
    //                        }

    //                        break;
    //                    }
    //                case 1:
    //                    {
    //                        if (state_timer > states_array[state_index].duration)
    //                        {
    //                            state_timer -= states_array[state_index].duration;
    //                            ++phase_index;
    //                        }

    //                        break;
    //                    }
    //                case 2:
    //                    {
    //                        float t = state_timer / states_array[state_index].lerp;
    //                        splash_screen.color = Color.Lerp(solid_colour, faded_colour, t);

    //                        if (state_timer > states_array[state_index].lerp)
    //                        {
    //                            state_timer -= states_array[state_index].lerp;
    //                            phase_index = 0;
    //                            ++state_index;
    //                        }

    //                        break;
    //                    }
    //                default:
    //                    {
    //                        Debug.Log("Splash Screen phase switch statement out of index");
    //                        break;
    //                    }
    //            }
    //        }
    //    }
    //    else
    //    {
    //        startButton.SetActive(true);
    //        quitButton.SetActive(true);

    //        is_running = false;
    //    }
    //}

    void VideoEnded(UnityEngine.Video.VideoPlayer vp)
    {
        vp.Stop();
        //is_running = true;

        mainMenu.SetActive(true);
    }
コード例 #6
0
 void EndReached(UnityEngine.Video.VideoPlayer vp)
 {
     //GameController.instance.JustWait(sCutscene);
     // sCutscene.gameObject.SetActive(true);
     //StaticValues.level++;
     GameController.instance.LoadLevel("CutscenesHub");
 }
コード例 #7
0
ファイル: VideoPlayer_.cs プロジェクト: MahalderRaj/UnityAR
    void CheckOver(UnityEngine.Video.VideoPlayer vp)
    {
        print("Video Is Over");

        try{
            gameObject.transform.parent.gameObject.GetComponent <Animator>().SetTrigger("close");
            Invoke("closeVideo", 1.5f);
        }catch (Exception e) {
        }

        try{
            Animation anim = transform.parent.gameObject.GetComponent <Animation>();

            foreach (AnimationState state in anim)
            {
                Debug.Log(state.name);
                if (state.name.Contains("close"))
                {
                    anim.Play(state.name);
                    return;
                }
            }
        }catch (Exception e) {
        }
    }
コード例 #8
0
 private void EndReached(UnityEngine.Video.VideoPlayer startAnim)
 {
     if (PhotonNetwork.IsMasterClient)
     {
         PhotonNetwork.LoadLevel(MultiplayerSettings.multiplayerSettings.multiplayerScene);
     }
 }
コード例 #9
0
 void EndReached(UnityEngine.Video.VideoPlayer vp)
 {
     Debug.Log("End of the video animation");
     videoPlayer.Pause();
     //dialogBox.SetActive(true);
     continueToGame();
 }
コード例 #10
0
ファイル: VideoPlayerAgent.cs プロジェクト: Ahgares/ReposVR
        private void Start()
        {
            player        = GetComponent <UnityEngine.Video.VideoPlayer>();
            player.source = VideoSource.Url;

            var path = Application.streamingAssetsPath + "/" + VideoInStreamingAssets;

            if (Application.platform == RuntimePlatform.Android)
            {
                path = Application.persistentDataPath + "/" + VideoInStreamingAssets;
            }

            // Note: Use the Unity VideoPlayer in your own way.
            // We use video file in StreamingAssets in the samples only to keep compatiblity.
            // Some versions of Unity will have strange behaviors if video in resources.
            if (Application.platform == RuntimePlatform.Android && !File.Exists(path) && !path.StartsWith("https://"))
            {
                StartCoroutine(FileUtil.LoadFile(VideoInStreamingAssets, PathType.StreamingAssets, (data) =>
                {
                    StartCoroutine(WriteFile(path, data));
                }));
            }
            else
            {
                player.url = path;
                ready      = true;
                StatusChanged();
            }
        }
コード例 #11
0
 //Check to see if the video is done playing
 void CheckOver(UnityEngine.Video.VideoPlayer vp)
 {
     //print("Video Is Over");
     playing = false;
     anim.SetTrigger("ScreenClose");
     stopMontage = true;
 }
コード例 #12
0
 void EndReached(UnityEngine.Video.VideoPlayer vp)
 {
     vplayer.clip      = videoloop;
     vplayer.isLooping = true;
     vplayer.Play();
     vplayer.loopPointReached -= EndReached;
 }
コード例 #13
0
 // Invoked on video preparation.
 private void OnPrepareCompleted(UnityEngine.Video.VideoPlayer source)
 {
     if (!_isPreviousTextureSet)
     {
         _previousTexture      = source.texture;
         _isPreviousTextureSet = true;
     }
 }
コード例 #14
0
 void EndReached(UnityEngine.Video.VideoPlayer vp)
 {
     // Reset video to first frame
     vp.frame             = 0;
     RenderTexture.active = vp.targetTexture;
     GL.Clear(true, true, Color.black);
     RenderTexture.active = null;
 }
コード例 #15
0
 void EndReached(UnityEngine.Video.VideoPlayer vp)
 {
     /*
      * intro2.SetActive(true);
      * intro1.SetActive(false);
      */
     scenesController.LoadIntroScene();
 }
コード例 #16
0
 // 動画再生完了時に呼ばれる
 void EndReached(UnityEngine.Video.VideoPlayer vp)
 {
     Debug.Log("再生完了");
     vp.errorReceived -= ErrorReceived;
     Destroy(videoPlayer);
     videoPlayer = null;
     // 動画再生完了時の処理
 }
コード例 #17
0
 void EndReached(UnityEngine.Video.VideoPlayer vp)
 {
     // UI.Instance.screensManager.LoadScreen(2, true);
     Debug.Log("Time: " + videoPlayer.time);
     Debug.Log("End reached");
     lastTime = 0;
     playing  = false;
 }
コード例 #18
0
ファイル: CutsceneEvents.cs プロジェクト: pontura/RunnerYPF
 void EndReached(UnityEngine.Video.VideoPlayer vp)
 {
     vplayer.loopPointReached -= EndReached;
     vplayer.Stop();
     print("____EndReached");
     Events.OnCutsceneFinal();
     Invoke("CutsceneClose", 3f);
 }
コード例 #19
0
    // when video finished
    void VideoEndReached(UnityEngine.Video.VideoPlayer vp)
    {
        vp.Pause();


        // back to menu screen
        VRControl.BackToMenu();
    }
コード例 #20
0
 void EndReach(UnityEngine.Video.VideoPlayer vp)
 {
     if (!isChangeScene)
     {
         Tools.GetComponent <Tools>().SendCheckTimeReq();
         isChangeScene = true;
     }
 }
コード例 #21
0
 /// <summary> 判断是否挂载 VideoPlayer </summary>
 public virtual void JudgeVideoPlayer(UnityEngine.Video.VideoPlayer videoPlayer)
 {
     if (videoPlayer == null)
     {
         Debug.LogError("当前 VideoPlayer 为空");
         return;
     }
 }
コード例 #22
0
 void EndReached(UnityEngine.Video.VideoPlayer vp)
 {
     // Close video screen
     //Debug.Log("End Reached");
     //videoPlayer.time = 0;
     videoPlayer.Stop();
     //trailer_plane.SetActive(false);
 }
コード例 #23
0
 private void EndReached(UnityEngine.Video.VideoPlayer vp)
 {
     Debug.Log("Video End Reached");
     if (vp == videoPlayer)
     {
         videoStopEvent?.Invoke();
     }
 }
コード例 #24
0
 public void prepered(UnityEngine.Video.VideoPlayer vp)
 {
     if (shouldStartPlaying)
     {
         startPlaying();
         shouldStartPlaying = false;
     }
 }
コード例 #25
0
        /// <summary> 获取视频播放的进度时间 </summary>
        public virtual float GetCurrentTime(UnityEngine.Video.VideoPlayer videoPlayer)
        {
            JudgeVideoPlayer(videoPlayer);

            float videoTime = videoPlayer.frame;

            return(videoTime);
        }
コード例 #26
0
    private void CheckOverM3(UnityEngine.Video.VideoPlayer memory3)
    {
        Debug.Log("VideoManager M3 - done");
        m3DonePlaying();//event

        Dmanag.DisplayNextSentence();
        //GameObject.FindGameObjectWithTag("DialogueManager").GetComponent<DialogueManager>().DisplayNextSentence();
    }
コード例 #27
0
    void Prepared(UnityEngine.Video.VideoPlayer vPlayer)
    {
        Debug.Log("End reached!");

        // vPlayer.Play();
        StartCoroutine(DelayPlayVideo());
        videoplayer.prepareCompleted -= Prepared;
    }
コード例 #28
0
ファイル: CinematicPlayer.cs プロジェクト: Absidion/Irkalla
 void EndReached(UnityEngine.Video.VideoPlayer vp)
 {
     vp.targetCameraAlpha = 0;
     vp.Stop();
     isPlaying = false;
     hasPlayed = true;
     m_LocalPlayer.Health.IsInvincible = false;
     PlayerHUDManager.instance.gameObject.SetActive(true);
 }
コード例 #29
0
    //private GvrReticlePointer pointer;

    //[SerializeField]
    //private AudioSource audioSource;

    void Start()
    {
        videoPlayer = videosphere.GetComponent <VideoPlayer> ();
        //pointer = pointerObj.GetComponent<GvrReticlePointer> ();
//		if (videoPlayer.clip != null) {
//			videoPlayer.EnableAudioTrack (0, true);
//			videoPlayer.SetTargetAudioSource(0, audioSource);
//		}
    }
コード例 #30
0
 void EndReached(UnityEngine.Video.VideoPlayer vp)
 {
     vplayer.time = 0;
     vplayer.Pause();
     setup = true;
     //stillQuad.SetActive(true);
     //vplayer.enabled = false;
     //speakTM.SetActive(true);
 }