Exemplo n.º 1
0
        // Update is called once per frame
        void Update()
        {
//			if (Input.GetButtonDown ("Button4")) {
//				var d = distractions [Random.Range (0, distractions.Length)];
//				print ("Playing distractor: " + d.distractionName);
//				d.TriggerDistraction (null);
//				return;
//			}
//		}

            if (timer.isComplete)
            {
                if (timerState == TimerState.Waiting)
                {
                    if (distractions.Length > 0)
                    {
                        currentDistraction = distractions [UnityEngine.Random.Range(0, distractions.Length)];
                        recordDistractors.WriteRow(Time.time + "," + currentDistraction.distractionName);
                        currentDistraction.TriggerDistraction(salienceController.salience, endDistraction);
                    }
                }
                timerState     = timerState.Next();
                timer.duration = timerState.Duration();
                timer.Start();
            }
        }
Exemplo n.º 2
0
        public void update()
        {
            snapshotTime   = DateTime.Now;
            timeSinceStart = snapshotTime - startTime;
            eye.Update();
            this.playerHeadPosition = playersTransform != null ? playersTransform.position : Vector3.zero;
            this.playerRotation     = playersTransform != null ? playersTransform.eulerAngles : Vector3.zero;
            this.gazePoint          = GetGazeObjectsPosition();
            this.gazeObjectName     = GetHitObjectName();
            this.distanceToObject   = GetHitObjectDistance();
            this.currentDistraction = distractionController.GetCurrentDistraction();

            var activeTask = TaskList.instance.GetActiveTask();

            this.activeTaskName   = activeTask != null ? activeTask.name : "";
            this.currentTaskState = activeTask != null?activeTask.GetCurrentState() : "";
        }
Exemplo n.º 3
0
 public DistractionController()
 {
     endDistraction = () => currentDistraction = null;
 }