Ejemplo n.º 1
0
    public void ClearGaze()
    {
        if (Player_LP.Instance.playerStatus != PlayerStatus.DraggingBoat)
        {
            myGazeStatus   = GazeStatus.None;
            objectOfMyGaze = null;

            if (UIManager_LP.Instance.textInstructionsPresent)
            {
                Debug.Log("Removing Text instructions");
                StartCoroutine(UIManager_LP.Instance.InstructionsTextOutgoing());
            }
        }
    }
Ejemplo n.º 2
0
    void processGaze()
    {
        RaycastHit hitInfo;

        if (gazeProvider)
        {
            if (Physics.Raycast(gazeProvider.GazeOrigin, gazeProvider.GazeDirection, out hitInfo, gazeMaxDistance, gazeLayerMask)) //Gaze hit something
            {
                //Debug.Log("<color=blue>Unity Gaze hit: " + hitInfo.collider.name + "</color>");
                gazeStatus   = GazeStatus.VALID;
                gazeHitpoint = hitInfo.point; //Store hitInfo until next frame

                if (uiState == UIState.DISPLAYING_MENU || uiState == UIState.IDLE)
                {
                    GameObject objHit = hitInfo.collider.gameObject;
                    if (buttonInGaze && buttonInGaze.gameObject != objHit) //Hit a button last frame and objHit is not that button
                    {
                        buttonInGaze.onHoverStop(primaryColor);            //Was hovering on button
                    }

                    buttonInGaze = objHit.GetComponent <InterfaceButton>();

                    if (buttonInGaze) //objHit is an InterfaceButton
                    {
                        buttonInGaze.onHoverStart(buttonHighlightColor);
                    }
                }
                else if (uiState == UIState.MARKING_HAZARD || uiState == UIState.SETTING_WAYPOINT)
                {
                    if (markerBeingPlaced && gazeProvider.HitInfo.collider.gameObject != markerBeingPlaced) //Marker is not null && not looking at the marker
                    {
                        markerBeingPlaced.transform.position = gazeHitpoint;
                    }
                    buttonInGaze = null;
                }
            }
            else
            {
                buttonInGaze = null;
                gazeStatus   = GazeStatus.INVALID;
                //Debug.Log("<color=red>Gaze hit nothing</color>");
            }
        }
        else
        {
            gazeStatus = GazeStatus.INVALID;
            //Debug.Log("<color=red>Gaze Provider is null</color>");
        }
    }
Ejemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     //objectOfMyGaze = null;
     myGazeStatus = GazeStatus.None;
 }