Add detective board
This commit is contained in:
@@ -26,18 +26,19 @@ namespace Unheimlich.Managers
|
||||
[Header("Input Values (Read only)")]
|
||||
public Vector2 MoveInput;
|
||||
public Vector2 LookInput;
|
||||
public InputActionReference JumpAction;
|
||||
public InputActionReference InteractAction;
|
||||
public InputActionReference DiapasonAction;
|
||||
|
||||
public static bool IsInputEnabled { get; private set; } = true;
|
||||
public static bool IsLookingEnabled { get; private set; } = true;
|
||||
public static InputContext CurrentContext { get; private set; } = InputContext.Normal;
|
||||
|
||||
private InputActionMap _playerActionMap;
|
||||
private InputAction _moveAction;
|
||||
private InputAction _lookAction;
|
||||
private InputAction _jumpAction;
|
||||
private InputAction _interactAction;
|
||||
private InputAction _diapasonAction;
|
||||
private InputAction _fireAction;
|
||||
private InputAction _exitAction;
|
||||
|
||||
private PlayerMovement _playerMovement;
|
||||
private PlayerLook _playerLook;
|
||||
@@ -51,14 +52,13 @@ namespace Unheimlich.Managers
|
||||
playerInput.actions.Enable();
|
||||
|
||||
_playerActionMap = playerInput.actions.FindActionMap("Player");
|
||||
_moveAction = _playerActionMap.FindAction("Move");
|
||||
_lookAction = _playerActionMap.FindAction("Look");
|
||||
_jumpAction = _playerActionMap.FindAction("Jump");
|
||||
_interactAction = _playerActionMap.FindAction("Interact");
|
||||
_diapasonAction = _playerActionMap.FindAction("Diapason");
|
||||
|
||||
JumpAction.action.Enable();
|
||||
InteractAction.action.Enable();
|
||||
if (DiapasonAction != null)
|
||||
DiapasonAction.action.Enable();
|
||||
_fireAction = _playerActionMap.FindAction("Fire");
|
||||
_exitAction = _playerActionMap.FindAction("Exit");
|
||||
|
||||
_playerMovement = GetComponent<PlayerMovement>();
|
||||
_playerLook = GetComponent<PlayerLook>();
|
||||
@@ -101,7 +101,11 @@ namespace Unheimlich.Managers
|
||||
Instance._lookAction.Enable();
|
||||
if (Instance._diapasonAction != null)
|
||||
Instance._diapasonAction.Enable();
|
||||
Instance.SetComponentsEnabled(false, false, false);
|
||||
if (Instance._fireAction != null)
|
||||
Instance._fireAction.Enable();
|
||||
if (Instance._exitAction != null)
|
||||
Instance._exitAction.Enable();
|
||||
Instance.SetComponentsEnabled(false, false, true);
|
||||
IsInputEnabled = false;
|
||||
IsLookingEnabled = false;
|
||||
break;
|
||||
@@ -152,5 +156,24 @@ namespace Unheimlich.Managers
|
||||
public void OnDiapason(InputAction.CallbackContext context)
|
||||
{
|
||||
}
|
||||
|
||||
public void OnFire(InputAction.CallbackContext context)
|
||||
{
|
||||
}
|
||||
|
||||
public void OnExit(InputAction.CallbackContext context)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Provides public access to input actions for other systems.
|
||||
/// </summary>
|
||||
public static InputAction GetMoveAction() => Instance?._moveAction;
|
||||
public static InputAction GetLookAction() => Instance?._lookAction;
|
||||
public static InputAction GetJumpAction() => Instance?._jumpAction;
|
||||
public static InputAction GetInteractAction() => Instance?._interactAction;
|
||||
public static InputAction GetDiapasonAction() => Instance?._diapasonAction;
|
||||
public static InputAction GetFireAction() => Instance?._fireAction;
|
||||
public static InputAction GetExitAction() => Instance?._exitAction;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user