/* * Activates the correct gaze scripts on the * target object. * Called when cursor timer has completed */ void ActivateGazeObject(Gazeable[] gazeScripts) { //Resets the cursor if the object activates ResetCursor(true); //object has now been activated objectActivated = true; //checks every gaze script on the object foreach (Gazeable gazeObject in gazeScripts) { //checks if the object's gaze conditions have been met if (gazeObject.CheckGazeConditions()) { //activates the gazeable object gazeObject.Activate(); } } }
/* * Deactivates an already activated object, by * individually deactivating each gaze script * on the object */ void DeactivateGazeObject(Gazeable[] gazeScripts) { //checks every gaze script on the object foreach (Gazeable gazeObject in gazeScripts) { //calls the deactivate method on the object gazeObject.Deactivate(); } }
/* * Checks if ANY gaze conditions on the object are met. * Used to determine if cursor timer should start */ bool SearchGazeConditions(Gazeable[] gazeScripts) { //checks each gaze script on the object foreach (Gazeable gazeObject in gazeScripts) { //checks gaze conditions on the script if (gazeObject.CheckGazeConditions()) { //returns true if conditions are met return true; } } //returns false if conditions are not met return false; }
/* * Checks if the user was looking at an Activated object * before looking away, and if so, deactivate the object. */ void CheckDeactivate(Gazeable[] gazeScripts) { //if the object has already been activated if (objectActivated) { //deactivate the object DeactivateGazeObject(gazeScripts); } }