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; } }
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; } }
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; } }