Ejemplo n.º 1
0
        private void OnMenuSceneLoaded()
        {
            var pointer = Resources.FindObjectsOfTypeAll <VRPointer>().First();

            if (pointer == null)
            {
                return;
            }

            if (_moverPointer)
            {
                _moverPointer.wasMoved -= ScreenWasMoved;
                Destroy(_moverPointer);
            }
            _moverPointer = pointer.gameObject.AddComponent <MoverPointer>();
            _moverPointer.Init(screen.transform);
            _moverPointer.wasMoved += ScreenWasMoved;

            if (currentVideo != null)
            {
                PrepareVideo(currentVideo);
            }
            PauseVideo();
            HideScreen();
        }
Ejemplo n.º 2
0
        private void OnGameSceneLoaded()
        {
            var pointer = Resources.FindObjectsOfTypeAll <VRPointer>().Last();

            if (pointer == null)
            {
                return;
            }
            if (_moverPointer)
            {
                _moverPointer.wasMoved -= ScreenWasMoved;
                Destroy(_moverPointer);
            }
            _moverPointer = pointer.gameObject.AddComponent <MoverPointer>();
            _moverPointer.Init(screen.transform);
            _moverPointer.wasMoved += ScreenWasMoved;

            if (videoPlayer.time != offsetSec)
            {
                // game was restarted
                if (currentVideo.offset >= 0)
                {
                    videoPlayer.time = offsetSec;
                }
                else
                {
                    videoPlayer.time = 0;
                }
            }
            PlayVideo();
        }
Ejemplo n.º 3
0
        private void OnGameSceneLoaded()
        {
            var pointer = Resources.FindObjectsOfTypeAll <VRPointer>().Last();

            Console.WriteLine("Pointer " + pointer?.name);
            if (pointer == null)
            {
                return;
            }
            if (_moverPointer)
            {
                _moverPointer.wasMoved -= ScreenWasMoved;
                Destroy(_moverPointer);
            }
            _moverPointer = pointer.gameObject.AddComponent <MoverPointer>();
            _moverPointer.Init(screen.transform);
            _moverPointer.wasMoved += ScreenWasMoved;

            PlayVideo();
        }