private void OnSelectionPerformed(InputAction.CallbackContext context) { if (!_isFigureLoaded) { return; } if (_shouldSelectSet && _figureSetInput != null) { _figureSetInput.HaveFocus = true; return; } var ray = _camera.ScreenPointToRay(Mouse.current.position.ReadValue()); if (!Physics.Raycast(ray, out var hit)) { return; } var figureInput = hit.collider.gameObject.GetComponent <FigureInput>(); if (figureInput == null) { return; } figureInput.HaveFocus = true; _focusedFigureInput = figureInput; }
private void OnSelectionCancelled(InputAction.CallbackContext context) { if (_figureSetInput != null) { _figureSetInput.HaveFocus = false; } if (_focusedFigureInput != null) { _focusedFigureInput.HaveFocus = false; _focusedFigureInput = null; } }