Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void UpdateSelection()
- {
- if (!Camera.main) return;
- RaycastHit hit;
- float raycastDistance = 25.0f;
- if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hit, raycastDistance, LayerMask.GetMask("ChessPlane")))
- {
- selectionX = (int)hit.point.x;
- selectionY = (int)hit.point.z;
- }
- else
- {
- selectionX = -1;
- selectionY = -1;
- }
- }
Add Comment
Please, Sign In to add comment