// Update is called once per frame void Update() { // Mosue Position mouse_position = Input.mousePosition; // Finds transfom object hit by mouse Ray cam_ray = cam_editor.ScreenPointToRay(mouse_position); RaycastHit hit; if (Physics.Raycast(cam_ray.origin, cam_ray.direction, out hit, Mathf.Infinity)) { node_hover_over = hit.collider.transform; } else { node_hover_over = null; } // Update class variables in regards to a click UpdateMouseNodeClick(); // Updates class variable: mouse_wheel UpdateMouseWheel(); // Updates class variable: left_click_drag UpdateLeftClickDrag(); }
//----------------------- void Update() { screenPointRay = cameraPerspectiveEditor.ScreenPointToRay(Input.mousePosition); Debug.DrawRay(screenPointRay.origin, screenPointRay.direction * (thisCamera.farClipPlane - thisCamera.nearClipPlane)); }