diff --git a/Assets/Input/PlayerInput.cs b/Assets/Input/PlayerInput.cs index 66b3e589f06add0d765d37d4b3d21f48e032b4bf..06c2b1c6a8e61f7df58b38a0ac4785964fda33bd 100644 --- a/Assets/Input/PlayerInput.cs +++ b/Assets/Input/PlayerInput.cs @@ -36,6 +36,15 @@ public partial class @PlayerInput: IInputActionCollection2, IDisposable ""interactions"": """", ""initialStateCheck"": true }, + { + ""name"": ""Navigate"", + ""type"": ""PassThrough"", + ""id"": ""f687166c-7d2b-474f-98be-1184ef03acde"", + ""expectedControlType"": ""Vector2"", + ""processors"": """", + ""interactions"": """", + ""initialStateCheck"": false + }, { ""name"": ""Reload"", ""type"": ""Button"", @@ -98,6 +107,15 @@ public partial class @PlayerInput: IInputActionCollection2, IDisposable ""processors"": """", ""interactions"": """", ""initialStateCheck"": false + }, + { + ""name"": ""Pause"", + ""type"": ""Button"", + ""id"": ""465a18ae-0a13-4077-8e39-57e663653925"", + ""expectedControlType"": ""Button"", + ""processors"": """", + ""interactions"": """", + ""initialStateCheck"": false } ], ""bindings"": [ @@ -269,7 +287,7 @@ public partial class @PlayerInput: IInputActionCollection2, IDisposable { ""name"": """", ""id"": ""a061e425-1521-4518-a642-2321104a77d5"", - ""path"": ""<Gamepad>/buttonWest"", + ""path"": ""<Gamepad>/buttonEast"", ""interactions"": """", ""processors"": """", ""groups"": """", @@ -353,6 +371,292 @@ public partial class @PlayerInput: IInputActionCollection2, IDisposable ""action"": ""Reload"", ""isComposite"": false, ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""7bbe84c3-8b40-4925-825b-8397e74767ae"", + ""path"": ""<Keyboard>/{Back}"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Pause"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""86a083b5-9fcc-4475-9a3f-509dd707adf2"", + ""path"": ""<Gamepad>/start"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Pause"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": ""Gamepad"", + ""id"": ""926fa617-ccd9-4a6e-9820-7ae91bdefb29"", + ""path"": ""2DVector"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Navigate"", + ""isComposite"": true, + ""isPartOfComposite"": false + }, + { + ""name"": ""up"", + ""id"": ""2ee2e3d5-a71c-4fde-b371-f9586bba420e"", + ""path"": ""<Gamepad>/leftStick/up"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""up"", + ""id"": ""6e109741-6231-4cd4-af09-0e40da6d9e0b"", + ""path"": ""<Gamepad>/rightStick/up"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""down"", + ""id"": ""049d096e-ef11-4540-bb06-83d051a06a0b"", + ""path"": ""<Gamepad>/leftStick/down"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""down"", + ""id"": ""3a1b5bc4-4305-49c0-8c91-1c8baf9a5791"", + ""path"": ""<Gamepad>/rightStick/down"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""left"", + ""id"": ""6c0b6cd9-3301-46d6-9c97-a405b56d7b0b"", + ""path"": ""<Gamepad>/leftStick/left"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""left"", + ""id"": ""b4859db8-7911-4c7c-a50a-5a25b3d160f0"", + ""path"": ""<Gamepad>/rightStick/left"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""right"", + ""id"": ""b0ff47d0-f8fb-4165-ab48-1a40a14e076a"", + ""path"": ""<Gamepad>/leftStick/right"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""right"", + ""id"": ""96d5e0e7-8fcf-450e-ab26-3f70dc45c4a8"", + ""path"": ""<Gamepad>/rightStick/right"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": """", + ""id"": ""3d524883-6af9-4ea5-9a00-57af7dc78410"", + ""path"": ""<Gamepad>/dpad"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": ""Joystick"", + ""id"": ""ce346f12-bafa-4f3b-9cbc-fd7591eca22a"", + ""path"": ""2DVector"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Navigate"", + ""isComposite"": true, + ""isPartOfComposite"": false + }, + { + ""name"": ""up"", + ""id"": ""d3cea910-c764-4d94-9553-ae8047a8bab4"", + ""path"": ""<Joystick>/stick/up"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""down"", + ""id"": ""9a2594a2-95cc-4c9e-9f36-94bacad11fae"", + ""path"": ""<Joystick>/stick/down"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""left"", + ""id"": ""c4224e05-5c23-401b-8cac-ccd2e09c46bf"", + ""path"": ""<Joystick>/stick/left"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""right"", + ""id"": ""cc217317-b48b-4e04-97ce-48472b734ce1"", + ""path"": ""<Joystick>/stick/right"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""Keyboard"", + ""id"": ""61b5ee3a-f26b-490f-9c87-b1081de3929b"", + ""path"": ""2DVector"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Navigate"", + ""isComposite"": true, + ""isPartOfComposite"": false + }, + { + ""name"": ""up"", + ""id"": ""44747854-f7e9-45e1-8e71-9bd54caea0db"", + ""path"": ""<Keyboard>/w"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""up"", + ""id"": ""c77697e8-c920-46af-b13f-b233327ee1f1"", + ""path"": ""<Keyboard>/upArrow"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""down"", + ""id"": ""d0b98590-eb42-434c-b119-5de336d4a9cf"", + ""path"": ""<Keyboard>/s"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""down"", + ""id"": ""b2dae028-0c13-409b-b46a-630d7ff923b0"", + ""path"": ""<Keyboard>/downArrow"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""left"", + ""id"": ""ac9e021a-a5c1-4ded-9193-014562b29f7d"", + ""path"": ""<Keyboard>/a"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""left"", + ""id"": ""86c58c53-83a3-4463-bd06-120bacc1effc"", + ""path"": ""<Keyboard>/leftArrow"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""right"", + ""id"": ""38b66a98-ae4d-427c-a4ea-fc307a1c082c"", + ""path"": ""<Keyboard>/d"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""right"", + ""id"": ""dfd4f2ad-b344-4e03-8676-5d7311fe38e8"", + ""path"": ""<Keyboard>/rightArrow"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true } ] }, @@ -878,6 +1182,7 @@ public partial class @PlayerInput: IInputActionCollection2, IDisposable // OnFoot m_OnFoot = asset.FindActionMap("OnFoot", throwIfNotFound: true); m_OnFoot_Movement = m_OnFoot.FindAction("Movement", throwIfNotFound: true); + m_OnFoot_Navigate = m_OnFoot.FindAction("Navigate", throwIfNotFound: true); m_OnFoot_Reload = m_OnFoot.FindAction("Reload", throwIfNotFound: true); m_OnFoot_Shoot = m_OnFoot.FindAction("Shoot", throwIfNotFound: true); m_OnFoot_Jump = m_OnFoot.FindAction("Jump", throwIfNotFound: true); @@ -885,6 +1190,7 @@ public partial class @PlayerInput: IInputActionCollection2, IDisposable m_OnFoot_Interact = m_OnFoot.FindAction("Interact", throwIfNotFound: true); m_OnFoot_OpenTerminal = m_OnFoot.FindAction("OpenTerminal", throwIfNotFound: true); m_OnFoot_Sprint = m_OnFoot.FindAction("Sprint", throwIfNotFound: true); + m_OnFoot_Pause = m_OnFoot.FindAction("Pause", throwIfNotFound: true); // UI m_UI = asset.FindActionMap("UI", throwIfNotFound: true); m_UI_Navigate = m_UI.FindAction("Navigate", throwIfNotFound: true); @@ -959,6 +1265,7 @@ public partial class @PlayerInput: IInputActionCollection2, IDisposable private readonly InputActionMap m_OnFoot; private List<IOnFootActions> m_OnFootActionsCallbackInterfaces = new List<IOnFootActions>(); private readonly InputAction m_OnFoot_Movement; + private readonly InputAction m_OnFoot_Navigate; private readonly InputAction m_OnFoot_Reload; private readonly InputAction m_OnFoot_Shoot; private readonly InputAction m_OnFoot_Jump; @@ -966,11 +1273,13 @@ public partial class @PlayerInput: IInputActionCollection2, IDisposable private readonly InputAction m_OnFoot_Interact; private readonly InputAction m_OnFoot_OpenTerminal; private readonly InputAction m_OnFoot_Sprint; + private readonly InputAction m_OnFoot_Pause; public struct OnFootActions { private @PlayerInput m_Wrapper; public OnFootActions(@PlayerInput wrapper) { m_Wrapper = wrapper; } public InputAction @Movement => m_Wrapper.m_OnFoot_Movement; + public InputAction @Navigate => m_Wrapper.m_OnFoot_Navigate; public InputAction @Reload => m_Wrapper.m_OnFoot_Reload; public InputAction @Shoot => m_Wrapper.m_OnFoot_Shoot; public InputAction @Jump => m_Wrapper.m_OnFoot_Jump; @@ -978,6 +1287,7 @@ public partial class @PlayerInput: IInputActionCollection2, IDisposable public InputAction @Interact => m_Wrapper.m_OnFoot_Interact; public InputAction @OpenTerminal => m_Wrapper.m_OnFoot_OpenTerminal; public InputAction @Sprint => m_Wrapper.m_OnFoot_Sprint; + public InputAction @Pause => m_Wrapper.m_OnFoot_Pause; public InputActionMap Get() { return m_Wrapper.m_OnFoot; } public void Enable() { Get().Enable(); } public void Disable() { Get().Disable(); } @@ -990,6 +1300,9 @@ public partial class @PlayerInput: IInputActionCollection2, IDisposable @Movement.started += instance.OnMovement; @Movement.performed += instance.OnMovement; @Movement.canceled += instance.OnMovement; + @Navigate.started += instance.OnNavigate; + @Navigate.performed += instance.OnNavigate; + @Navigate.canceled += instance.OnNavigate; @Reload.started += instance.OnReload; @Reload.performed += instance.OnReload; @Reload.canceled += instance.OnReload; @@ -1011,6 +1324,9 @@ public partial class @PlayerInput: IInputActionCollection2, IDisposable @Sprint.started += instance.OnSprint; @Sprint.performed += instance.OnSprint; @Sprint.canceled += instance.OnSprint; + @Pause.started += instance.OnPause; + @Pause.performed += instance.OnPause; + @Pause.canceled += instance.OnPause; } private void UnregisterCallbacks(IOnFootActions instance) @@ -1018,6 +1334,9 @@ public partial class @PlayerInput: IInputActionCollection2, IDisposable @Movement.started -= instance.OnMovement; @Movement.performed -= instance.OnMovement; @Movement.canceled -= instance.OnMovement; + @Navigate.started -= instance.OnNavigate; + @Navigate.performed -= instance.OnNavigate; + @Navigate.canceled -= instance.OnNavigate; @Reload.started -= instance.OnReload; @Reload.performed -= instance.OnReload; @Reload.canceled -= instance.OnReload; @@ -1039,6 +1358,9 @@ public partial class @PlayerInput: IInputActionCollection2, IDisposable @Sprint.started -= instance.OnSprint; @Sprint.performed -= instance.OnSprint; @Sprint.canceled -= instance.OnSprint; + @Pause.started -= instance.OnPause; + @Pause.performed -= instance.OnPause; + @Pause.canceled -= instance.OnPause; } public void RemoveCallbacks(IOnFootActions instance) @@ -1177,6 +1499,7 @@ public partial class @PlayerInput: IInputActionCollection2, IDisposable public interface IOnFootActions { void OnMovement(InputAction.CallbackContext context); + void OnNavigate(InputAction.CallbackContext context); void OnReload(InputAction.CallbackContext context); void OnShoot(InputAction.CallbackContext context); void OnJump(InputAction.CallbackContext context); @@ -1184,6 +1507,7 @@ public partial class @PlayerInput: IInputActionCollection2, IDisposable void OnInteract(InputAction.CallbackContext context); void OnOpenTerminal(InputAction.CallbackContext context); void OnSprint(InputAction.CallbackContext context); + void OnPause(InputAction.CallbackContext context); } public interface IUIActions { diff --git a/Assets/Input/PlayerInput.inputactions b/Assets/Input/PlayerInput.inputactions index d83268867c81cc029ab9a1b5004bc3dbe22f4464..a6a5ca2f624aaa9ec282a9ddac4f56963c43a984 100644 --- a/Assets/Input/PlayerInput.inputactions +++ b/Assets/Input/PlayerInput.inputactions @@ -14,6 +14,15 @@ "interactions": "", "initialStateCheck": true }, + { + "name": "Navigate", + "type": "PassThrough", + "id": "f687166c-7d2b-474f-98be-1184ef03acde", + "expectedControlType": "Vector2", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, { "name": "Reload", "type": "Button", @@ -76,6 +85,15 @@ "processors": "", "interactions": "", "initialStateCheck": false + }, + { + "name": "Pause", + "type": "Button", + "id": "465a18ae-0a13-4077-8e39-57e663653925", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false } ], "bindings": [ @@ -247,7 +265,7 @@ { "name": "", "id": "a061e425-1521-4518-a642-2321104a77d5", - "path": "<Gamepad>/buttonWest", + "path": "<Gamepad>/buttonEast", "interactions": "", "processors": "", "groups": "", @@ -331,6 +349,292 @@ "action": "Reload", "isComposite": false, "isPartOfComposite": false + }, + { + "name": "", + "id": "7bbe84c3-8b40-4925-825b-8397e74767ae", + "path": "<Keyboard>/{Back}", + "interactions": "", + "processors": "", + "groups": "", + "action": "Pause", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "86a083b5-9fcc-4475-9a3f-509dd707adf2", + "path": "<Gamepad>/start", + "interactions": "", + "processors": "", + "groups": "", + "action": "Pause", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "Gamepad", + "id": "926fa617-ccd9-4a6e-9820-7ae91bdefb29", + "path": "2DVector", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": true, + "isPartOfComposite": false + }, + { + "name": "up", + "id": "2ee2e3d5-a71c-4fde-b371-f9586bba420e", + "path": "<Gamepad>/leftStick/up", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "up", + "id": "6e109741-6231-4cd4-af09-0e40da6d9e0b", + "path": "<Gamepad>/rightStick/up", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "049d096e-ef11-4540-bb06-83d051a06a0b", + "path": "<Gamepad>/leftStick/down", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "3a1b5bc4-4305-49c0-8c91-1c8baf9a5791", + "path": "<Gamepad>/rightStick/down", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "6c0b6cd9-3301-46d6-9c97-a405b56d7b0b", + "path": "<Gamepad>/leftStick/left", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "b4859db8-7911-4c7c-a50a-5a25b3d160f0", + "path": "<Gamepad>/rightStick/left", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "b0ff47d0-f8fb-4165-ab48-1a40a14e076a", + "path": "<Gamepad>/leftStick/right", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "96d5e0e7-8fcf-450e-ab26-3f70dc45c4a8", + "path": "<Gamepad>/rightStick/right", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "", + "id": "3d524883-6af9-4ea5-9a00-57af7dc78410", + "path": "<Gamepad>/dpad", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "Joystick", + "id": "ce346f12-bafa-4f3b-9cbc-fd7591eca22a", + "path": "2DVector", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": true, + "isPartOfComposite": false + }, + { + "name": "up", + "id": "d3cea910-c764-4d94-9553-ae8047a8bab4", + "path": "<Joystick>/stick/up", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "9a2594a2-95cc-4c9e-9f36-94bacad11fae", + "path": "<Joystick>/stick/down", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "c4224e05-5c23-401b-8cac-ccd2e09c46bf", + "path": "<Joystick>/stick/left", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "cc217317-b48b-4e04-97ce-48472b734ce1", + "path": "<Joystick>/stick/right", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "Keyboard", + "id": "61b5ee3a-f26b-490f-9c87-b1081de3929b", + "path": "2DVector", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": true, + "isPartOfComposite": false + }, + { + "name": "up", + "id": "44747854-f7e9-45e1-8e71-9bd54caea0db", + "path": "<Keyboard>/w", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "up", + "id": "c77697e8-c920-46af-b13f-b233327ee1f1", + "path": "<Keyboard>/upArrow", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "d0b98590-eb42-434c-b119-5de336d4a9cf", + "path": "<Keyboard>/s", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "b2dae028-0c13-409b-b46a-630d7ff923b0", + "path": "<Keyboard>/downArrow", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "ac9e021a-a5c1-4ded-9193-014562b29f7d", + "path": "<Keyboard>/a", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "86c58c53-83a3-4463-bd06-120bacc1effc", + "path": "<Keyboard>/leftArrow", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "38b66a98-ae4d-427c-a4ea-fc307a1c082c", + "path": "<Keyboard>/d", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "dfd4f2ad-b344-4e03-8676-5d7311fe38e8", + "path": "<Keyboard>/rightArrow", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true } ] }, diff --git a/Assets/Script/Menu/PauseMenu.cs b/Assets/Script/Menu/PauseMenu.cs index 4dde3eb0e7575c6a32bd9cc47a89bcbbd11fcdeb..b6c03a339767dd113c40e72e62e877892d287b27 100644 --- a/Assets/Script/Menu/PauseMenu.cs +++ b/Assets/Script/Menu/PauseMenu.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; +using UnityEngine.UI; public class PauseMenu : MonoBehaviour { @@ -17,6 +18,10 @@ public class PauseMenu : MonoBehaviour public GameObject shopHUD; private InputManager inputManager; + public Button defaultPause; + public Button defaultSave; + public Slider defaultSettings; + void Start() { inputManager = player.GetComponent<InputManager>(); @@ -26,7 +31,7 @@ public class PauseMenu : MonoBehaviour // Update is called once per frame void Update() { - if (Input.GetKeyDown(KeyCode.Escape)) + if (Input.GetKeyDown(KeyCode.Escape) || Input.GetKeyDown(KeyCode.JoystickButton7)) { if (GameIsPaused && !player.GetComponent<PlayerHealth>().isDead && !shopHUD.activeSelf) { @@ -62,6 +67,7 @@ public class PauseMenu : MonoBehaviour pauseMenuUI.SetActive(true); HUD.SetActive(false); + defaultPause.Select(); Time.timeScale = 0f; GameIsPaused = true; @@ -74,12 +80,14 @@ public class PauseMenu : MonoBehaviour { pauseMenuUI.SetActive(false); saveMenuUI.SetActive(true); + defaultSave.Select(); } public void Settings() { pauseMenuUI.SetActive(false); settingsMenuUI.SetActive(true); + defaultSettings.Select(); } public void Back() @@ -87,6 +95,7 @@ public class PauseMenu : MonoBehaviour pauseMenuUI.SetActive(true); settingsMenuUI.SetActive(false); saveMenuUI.SetActive(false); + defaultPause.Select(); } public void LoadMenu() diff --git a/Assets/Script/Shop/Shop.cs b/Assets/Script/Shop/Shop.cs index d124b503b517d111842e1263dd7cc9383ca270de..8dc87cc387dc9f54a0fa756fd833c8ea18009f47 100644 --- a/Assets/Script/Shop/Shop.cs +++ b/Assets/Script/Shop/Shop.cs @@ -21,6 +21,8 @@ public class Shop : MonoBehaviour public GameObject HUD; public TextMeshProUGUI playerGold; + public Button defaultShop; + void Start() { shopUI.SetActive(false); @@ -70,6 +72,7 @@ public class Shop : MonoBehaviour player.GetComponent<InputManager>().enabled = false; player.GetComponentInChildren<GunSystem>().enabled = false; HUD.SetActive(false); + defaultShop.Select(); } else { diff --git a/Assets/Script/Weapon/WeaponManager.cs b/Assets/Script/Weapon/WeaponManager.cs index 1df4cc9ec25dcdc362dda2af391e52388f9b0090..fbbee4069754af5cbfb9fec3d5772ef7eb2adcf4 100644 --- a/Assets/Script/Weapon/WeaponManager.cs +++ b/Assets/Script/Weapon/WeaponManager.cs @@ -18,6 +18,8 @@ public class WeaponManager : MonoBehaviour public Image weapon2; public Image weapon3; + private int weaponIndex; + public Sprite[] weaponSprites; private void Awake() @@ -36,6 +38,7 @@ public class WeaponManager : MonoBehaviour { currentWeapon = weapons[0]; currentWeaponName.SetText(currentWeapon.name); + weaponIndex = 0; } void Update() @@ -58,17 +61,20 @@ public class WeaponManager : MonoBehaviour } // Change weapon by pressing number keys - if (Input.GetKeyDown(KeyCode.Alpha1)) + if (Input.GetKeyDown(KeyCode.Alpha1) || (Input.GetKeyDown(KeyCode.JoystickButton3) && weaponIndex == 2)) { ChangeWeapon(0); + weaponIndex = (weaponIndex+1)%3; } - else if (Input.GetKeyDown(KeyCode.Alpha2)) + else if (Input.GetKeyDown(KeyCode.Alpha2) || (Input.GetKeyDown(KeyCode.JoystickButton3) && weaponIndex == 0)) { ChangeWeapon(1); + weaponIndex = (weaponIndex + 1) % 3; } - else if (Input.GetKeyDown(KeyCode.Alpha3)) + else if (Input.GetKeyDown(KeyCode.Alpha3) || (Input.GetKeyDown(KeyCode.JoystickButton3) && weaponIndex == 1)) { ChangeWeapon(2); + weaponIndex = (weaponIndex + 1) % 3; } // Change weapon by scrolling mouse wheel