private IEnumerator DelayAudioConnection() { yield return(new WaitForSeconds(0.25f)); ExpositionScreen.GetComponentInChildren <VideoPlayer>() .SetTargetAudioSource(0, GameObject .FindGameObjectWithTag("MainCamera") .GetComponentInChildren <AudioSource>()); }
/// <summary> /// Setup up its representation in the questionnaire system. /// </summary> /// <param name="qSystem"></param> public override void InitialiseRepresentation(QuestionnaireManager qSystem) { _qSystem = qSystem; _rawImage = ExpositionScreen.GetComponentInChildren <RawImage>(); _videoPlayer = ExpositionScreen.GetComponentInChildren <VideoPlayer>(); _currentIndex = 0; _currentDecision = 0; _randomisationOrder = Question.RandomisationOrder(_experimentParameters).ToArray(); if (Question.Configuration.Type == Type.Image) { _imgLocs = new Sprite[Question.Stimuli.Count]; for (var i = 0; i < Question.Stimuli.Count; i++) { _imgLocs[i] = Resources.Load <Sprite>(Question.Stimuli[i]); } } else { _vidLocs = new VideoClip[Question.Stimuli.Count]; for (var i = 0; i < Question.Stimuli.Count; i++) { _vidLocs[i] = Resources.Load <VideoClip>(Question.Stimuli[i]); } } if (Question.Configuration.Type == Type.Image) { _rawImage.texture = _imgLocs[_randomisationOrder[_currentIndex]].texture; } else { _videoPlayer.clip = _vidLocs[_randomisationOrder[_currentIndex]]; } if (previousCoroutine != null) { StopCoroutine(previousCoroutine); } previousCoroutine = StartCoroutine(Question.Configuration.SeparatorFirst ? SwitchToFixation(Question.Times.Fixation) : SwitchToNext(Question.Times.Exposition)); }
private void UpdateVisibility() { FixationSceen.SetActive(false); DecisionScreen.SetActive(false); ExpositionScreen.SetActive(false); if (_fixation) { FixationSceen.SetActive(true); } else if (_decide) { _inDecision = true; DecisionScreen.SetActive(true); } else { ExpositionScreen.SetActive(true); } }
// Use this for initialization void Awake() { _launchManager = GameObject .FindGameObjectWithTag("LaunchManager") .GetComponent <LaunchManager>(); _log = _launchManager.LoggingManager; _experimentParameters = _launchManager.SessionParameters; _osc = _launchManager.gameObject.GetComponent <OSC> (); if (ExpositionScreen != null) { ExpositionScreen.GetComponentInChildren <VideoPlayer>() .SetTargetAudioSource(0, GameObject .FindGameObjectWithTag("MainCamera") .GetComponentInChildren <AudioSource>()); } else { StartCoroutine(DelayAudioConnection()); } }