namespace Oculus.Platform.Samples.VrBoardGame { using UnityEngine; using UnityEngine.UI; using UnityEngine.EventSystems; // This is a helper class for selecting objects that the user is looking at. // It will select UI objects that have an attach 3d collision volume and helps // the GameController locate GamePieces and GamePositions. public class EyeCamera : MonoBehaviour { // the EventSystem used by the UI elements [SerializeField] private EventSystem m_eventSystem = null; // the GameController to notify [SerializeField] private GameController m_gameController = null; // a tine ball in the distance to debug where the user is looking [SerializeField] private SphereCollider m_gazeTracker = null; // the current Button, if any, being looked at private Button m_currentButton; // the current GamePiece, if any, being looked at private GamePiece m_currentPiece; // the current BoardPosition, if any, being looked at private BoardPosition m_boardPosition; void Update() { RaycastHit hit; Button button = null; GamePiece piece = null; BoardPosition pos = null; // do a forward raycast to see if we hit a selectable object bool hitSomething = Physics.Raycast(transform.position, transform.forward, out hit, 50f); if (hitSomething) { button = hit.collider.GetComponent