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(); } }
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(); } }
public void OnBeginDrag(PointerEventData eventData) { IsDragging = true; MediaPlayerEventDispatcher.RaiseSphericalScreenBeginDrag(); }