コード例 #1
0
    public void Awake()
    {
        videoSamples    = new GameObject[6];
        videoSamples[0] = Video0;
        videoSamples[1] = Video1;
        videoSamples[2] = Video2;
        videoSamples[3] = Video3;
        videoSamples[4] = Video4;
        videoSamples[5] = Video5;

        string NATIVE_LIBS_MISSING_MESSAGE = "Video Support libraries not found or could not be loaded!\n" +
                                             "Please add the <b>GVRVideoPlayer.unitypackage</b>\n to this project";

        if (missingLibText != null)
        {
            try {
                IntPtr ptr = GvrVideoPlayerTexture.CreateVideoPlayer();
                if (ptr != IntPtr.Zero)
                {
                    GvrVideoPlayerTexture.DestroyVideoPlayer(ptr);
                    missingLibText.enabled = false;
                }
                else
                {
                    missingLibText.text    = NATIVE_LIBS_MISSING_MESSAGE;
                    missingLibText.enabled = true;
                }
            } catch (Exception e) {
                Debug.LogError(e);
                missingLibText.text    = NATIVE_LIBS_MISSING_MESSAGE;
                missingLibText.enabled = true;
            }
        }
    }
コード例 #2
0
ファイル: SwitchVideos.cs プロジェクト: idowolf/InGame4
    public void Awake()
    {
        videoSamples    = new GameObject[3];
        videoSamples[0] = localVideoSample;
        videoSamples[1] = dashVideoSample;
        videoSamples[2] = panoVideoSample;


        if (missingLibText != null)
        {
            try {
                IntPtr ptr = GvrVideoPlayerTexture.CreateVideoPlayer();
                if (ptr != IntPtr.Zero)
                {
                    GvrVideoPlayerTexture.DestroyVideoPlayer(ptr);
                    missingLibText.enabled = false;
                }
                else
                {
                    missingLibText.enabled = true;
                }
            } catch (Exception e) {
                Debug.LogError(e);
                missingLibText.enabled = true;
            }
        }

        missingLibText.text = "Game Over!\nScore: " + ScoreManager.score;
        ScoreManager.score  = 0;
    }
コード例 #3
0
        private void Awake()
        {
            if (instance == null)
            {
                instance = this;
            }
            else
            {
                Destroy(gameObject);
            }

            string NATIVE_LIBS_MISSING_MESSAGE = "Video Support libraries not found or could not be loaded!\n" +
                                                 "Please add the <b>GVRVideoPlayer.unitypackage</b>\n to this project";

            try
            {
                IntPtr ptr = GvrVideoPlayerTexture.CreateVideoPlayer();
                if (ptr != IntPtr.Zero)
                {
                    GvrVideoPlayerTexture.DestroyVideoPlayer(ptr);
                }
                else
                {
                    Debug.LogError(NATIVE_LIBS_MISSING_MESSAGE);
                }
            }
            catch (Exception e)
            {
                Debug.LogError(e);
                Debug.LogError(NATIVE_LIBS_MISSING_MESSAGE);
            }
        }
コード例 #4
0
        public void Awake()
        {
            videoSamples    = new GameObject[3];
            videoSamples[0] = localVideoSample;
            videoSamples[1] = dashVideoSample;
            videoSamples[2] = panoVideoSample;

            string NATIVE_LIBS_MISSING_MESSAGE = "Ambientes de teste para claustrofobia, escolha um dos ambientes deixando o ponto em cima por 5seg";

            if (missingLibText != null)
            {
                try {
                    IntPtr ptr = GvrVideoPlayerTexture.CreateVideoPlayer();
                    if (ptr != IntPtr.Zero)
                    {
                        GvrVideoPlayerTexture.DestroyVideoPlayer(ptr);
                        missingLibText.enabled = false;
                    }
                    else
                    {
                        missingLibText.text    = NATIVE_LIBS_MISSING_MESSAGE;
                        missingLibText.enabled = true;
                    }
                } catch (Exception e) {
                    Debug.LogError(e);
                    missingLibText.text    = NATIVE_LIBS_MISSING_MESSAGE;
                    missingLibText.enabled = true;
                }
            }
        }
コード例 #5
0
    public void Awake()
    {
        if (panoVideo == null)
        {
            Debug.LogError("Video should be pano video...");
            return;
        }

        try
        {
            IntPtr ptr = GvrVideoPlayerTexture.CreateVideoPlayer();
            if (ptr != IntPtr.Zero)
            {
                GvrVideoPlayerTexture.DestroyVideoPlayer(ptr);
            }
        }
        catch (Exception e)
        {
            Debug.LogError(e);
        }
    }