示例#1
0
        private IEnumerator StopDraggingAtEndOfFrame()
        {
            yield return(new WaitForEndOfFrame());

            IsDragging = false;
            MediaPlayerEventDispatcher.RaiseSphericalScreenEndDrag();
        }
        private IEnumerator NextFileAfterDelay()
        {
            while (true)
            {
                float timeRemainingSeconds = timeUntilNextPhotoSeconds;

                while (timeRemainingSeconds > 0.0f)
                {
                    timer.enabled = true;
                    float percentComplete = 1.0f - (timeRemainingSeconds / timeUntilNextPhotoSeconds);
                    timer.fillAmount      = percentComplete;
                    timeRemainingSeconds -= Time.deltaTime;
                    yield return(null);
                }

                MediaPlayerEventDispatcher.RaiseNextFile();
            }
        }
示例#3
0
        public void OnPointerClick(PointerEventData eventData)
        {
            switch (eventType)
            {
            case Event.ExitMedia:
                MediaPlayerEventDispatcher.RaiseExitMedia();
                break;

            case Event.NextFile:
                MediaPlayerEventDispatcher.RaiseNextFile();
                break;

            case Event.PreviousFile:
                MediaPlayerEventDispatcher.RaisePreviousFile();
                break;

            default:
                Debug.LogError("Unsupported Event: " + eventType);
                break;
            }
        }
        void Update()
        {
            if (playbackControls == null)
            {
                return;
            }

            bool isManipulatingScreen = ConditionsManager.Instance.IsConditionTrue(ManipulatingScreenCondition.IDENTIFIER);

            if (isManipulatingScreen)
            {
                return;
            }

            if (GvrControllerInput.ClickButtonUp && !playbackControls.IsPointerHovering)
            {
                TogglePlaybackControls();
            }

            bool isControllerIdle        = ConditionsManager.Instance.IsConditionTrue(ControllerIdleCondition.IDENTIFIER);
            bool shouldAutoCloseControls = isControllerIdle && !playbackControls.IsPointerHovering;

            if (shouldAutoCloseControls && closeAfterDelayCoroutine == null)
            {
                closeAfterDelayCoroutine = StartCoroutine(CloseAfterDelay(closeOnIdleDelaySeconds));
            }

            if (!shouldAutoCloseControls && closeAfterDelayCoroutine != null)
            {
                StopCoroutine(closeAfterDelayCoroutine);
                closeAfterDelayCoroutine = null;
            }

            if (GvrControllerInput.AppButtonUp)
            {
                MediaPlayerEventDispatcher.RaiseExitMedia();
            }
        }
示例#5
0
 public void OnBeginDrag(PointerEventData eventData)
 {
     IsDragging = true;
     MediaPlayerEventDispatcher.RaiseSphericalScreenBeginDrag();
 }