Пример #1
0
    private void TrySelectObject()
    {
        RaycastHit2D hit = Physics2D.Raycast(playerInput.MousePos2D, Vector2.zero, Mathf.Infinity, playerInput.selectables);

        if (hit.collider != null)
        {
            SelectObject(hit.collider.gameObject);
        }
        else if (!playerInput.CursorOverUI)
        {
            uiPanelManager.CloseAll();
            SelectedObject           = null;
            playerInput.CurrentState = State.normal;
        }
    }
Пример #2
0
 public void OnDigPressesd()
 {
     uiPanelManager.CloseAll();
     playerInput.CurrentState = State.dig;
 }