Fix unity warnings

This commit is contained in:
Vova
2024-05-21 13:30:01 +03:00
parent 1584d904df
commit 516df5601f
65 changed files with 512 additions and 2329 deletions
@@ -14,7 +14,7 @@ public class InGameMouseHandler : UnityEngine.Object
private Camera _camera;
private BaseInteractableObject _selectedObject;
private bool _pressControl = false;
public InGameMouseHandler(Camera camera)
{
@@ -35,8 +35,9 @@ public class InGameMouseHandler : UnityEngine.Object
private void ClickToMove(InputAction.CallbackContext context)
{
if (!EventSystem.current.IsPointerOverGameObject())
if (_pressControl)
{
_pressControl = false;
GameManager.Instance.UI.ClosePopupMenu();
if (_selectedObject != null)
@@ -57,6 +58,9 @@ public class InGameMouseHandler : UnityEngine.Object
public void Update()
{
if (Mouse.current.leftButton.wasPressedThisFrame)
_pressControl = !EventSystem.current.IsPointerOverGameObject(PointerInputModule.kMouseLeftId);
_ray = _camera.ScreenPointToRay(Mouse.current.position.ReadValue());
if (Physics.Raycast(_ray, out var mouseRaycastHit, 100f, _selectableLayerMask))
{