public void NextButtonPressed(bool isPrevious) { var temp = _targetIndex; if (isPrevious) { if (_targetIndex - 1 >= 0) { _targetIndex--; } else { _targetIndex = _videoTargetContainer.Count - 1; } } else { if (_targetIndex + 1 < _videoTargetContainer.Count) { _targetIndex++; } else { _targetIndex = 0; } } FullScreenPreview.SetActive(true); //StopPlayerOnLost(false, _videoTargetContainer[temp].gameObject); //RendVideoScreen(false, _videoTargetContainer[temp]); //RendNextVideoScreenIfTracked(false, _videoTargetContainer[temp].gameObject); }
private void GetTrackedTarget(bool condition, TrackableEventHandler sender) { var target = sender.GetComponent <TargetTrack>(); if (condition) { //if(!_videoTargetContainer.Exists(x => x.DublicatedTarget == target)) // _videoTargetContainer.Add(target); Debug.Log(sender.gameObject.name + " is tracked"); //+ " on " + _trackedVideoPlayerTargets.IndexOf(target) + " index"); if (_trackedVideoPlayer == null || //TODO: check _trackedVideoPlayer == sender.GetComponentInChildren <VideoPlayer>()) { RendVideoScreen(true, target); } if (_videoTargetContainer.Count > 1 && !_isInFullScreenMod) { ShowSwitchButtons(true); } if (!_isInFullScreenMod) { FullScreenPreview.SetActive(true); } } else { //_videoTargetContainer.Remove(target); Debug.Log(sender.gameObject.name + " has lost"); RendVideoScreen(false, target); if (!_isInFullScreenMod) { if (_videoTargetContainer.Count == 0) { _trackedVideoPlayer = null; } if (_videoTargetContainer.Count == 1) { ShowSwitchButtons(false); } } } }
public void PlayButtonPressed() { if (_trackedVideoPlayer.isPlaying) { _trackedVideoPlayer.Pause(); _playButtonImage.overrideSprite = PlaySprite; } else { if (TrackedVideoPreview.activeInHierarchy) { _trackedVideoPlayer.GetComponent <LoadingAnimator123>().SetRunning(); TrackedVideoPreview.SetActive(false); } if (FullScreenPreview.activeInHierarchy) { FullScreenPlayer.GetComponent <LoadingAnimator123>().SetRunning(); FullScreenPreview.SetActive(false); } _trackedVideoPlayer.Play(); _playButtonImage.overrideSprite = PauseSprite; } }