Ejemplo n.º 1
0
    private void CheckForInput(RaycastHit hit)
    {
        if (Input.GetMouseButtonDown(0) && currentGazeObject != null)
        {
            currentSelectableObject = currentGazeObject;
            currentSelectableObject.OnPress(hit);
        }

        if (Input.GetMouseButtonDown(0) && currentSelectableObject != null)
        {
            currentSelectableObject.OnHold(hit);
        }

        if (Input.GetMouseButtonUp(0) && currentSelectableObject != null)
        {
            currentSelectableObject.OnRelease(hit);
            currentSelectableObject = null;
        }
    }
Ejemplo n.º 2
0
    private void CheckforInput(RaycastHit hitinfo)
    {
        if (Input.GetMouseButtonDown(0) && currentGazeObject != null)
        {
            currentSelectedObject = currentGazeObject;
            currentSelectedObject.OnPress(hitinfo);
        }

        // Check for hold
        else if (Input.GetMouseButton(0) && currentSelectedObject != null)
        {
            currentSelectedObject.OnHold(hitinfo);
        }
        // Check for release
        else if (Input.GetMouseButtonUp(0) && currentSelectedObject != null)
        {
            currentSelectedObject.OnRelease(hitinfo);
            currentSelectedObject = null;
        }
    }
Ejemplo n.º 3
0
 private void CheckForInput(RaycastHit hitInfo)
 {
     //Debug.Log(Input.GetMouseButton(0));
     //Debug.Log(currentGazeObject);
     if (currentGazeObject != null)
     {
         //Debug.Log(currentGazeObject);
     }
     //Check for down (press the button, in that very moment)
     if (Input.GetMouseButtonDown(0) && currentGazeObject != null)
     {
         currentSelectedObject = currentGazeObject;
         currentSelectedObject.OnPress(hitInfo);
     }
     else if (Input.GetMouseButton(0) && currentGazeObject != null)
     {                       //Check for hold (for frames after, with button stll down)
         currentSelectedObject.OnHold(hitInfo);
     }
     else if (Input.GetMouseButton(0) && currentGazeObject != null)
     {                       //Check for hold (for frames after, with button stll down)
         currentSelectedObject.OnRelease(hitInfo);
         currentSelectedObject = null;
     }
 }