Pauser Added + Fixed Bug

TODO: Stop Animations when Paused
This commit is contained in:
2022-02-26 19:53:47 +03:00
parent 33f81e5a1c
commit caab797e6d
10 changed files with 297 additions and 3 deletions

View File

@@ -64,6 +64,15 @@ namespace Input
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
},
{
""name"": ""Pause"",
""type"": ""Button"",
""id"": ""b110facd-253d-41ce-9de7-b589dc48cfc6"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
}
],
""bindings"": [
@@ -209,6 +218,28 @@ namespace Input
""action"": ""Climb"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""6a01ec66-e7a4-426a-8ee4-977d456b200c"",
""path"": ""<Gamepad>/start"",
""interactions"": """",
""processors"": """",
""groups"": ""Controller"",
""action"": ""Pause"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""279efb3d-768d-49fd-91f5-c74ebe08c880"",
""path"": ""<Keyboard>/escape"",
""interactions"": """",
""processors"": """",
""groups"": ""KeyBoard"",
""action"": ""Pause"",
""isComposite"": false,
""isPartOfComposite"": false
}
]
}
@@ -244,6 +275,7 @@ namespace Input
m_PlayerControl_Jump = m_PlayerControl.FindAction("Jump", throwIfNotFound: true);
m_PlayerControl_Interact = m_PlayerControl.FindAction("Interact", throwIfNotFound: true);
m_PlayerControl_Climb = m_PlayerControl.FindAction("Climb", throwIfNotFound: true);
m_PlayerControl_Pause = m_PlayerControl.FindAction("Pause", throwIfNotFound: true);
}
public void Dispose()
@@ -307,6 +339,7 @@ namespace Input
private readonly InputAction m_PlayerControl_Jump;
private readonly InputAction m_PlayerControl_Interact;
private readonly InputAction m_PlayerControl_Climb;
private readonly InputAction m_PlayerControl_Pause;
public struct PlayerControlActions
{
private @PlayerInput m_Wrapper;
@@ -315,6 +348,7 @@ namespace Input
public InputAction @Jump => m_Wrapper.m_PlayerControl_Jump;
public InputAction @Interact => m_Wrapper.m_PlayerControl_Interact;
public InputAction @Climb => m_Wrapper.m_PlayerControl_Climb;
public InputAction @Pause => m_Wrapper.m_PlayerControl_Pause;
public InputActionMap Get() { return m_Wrapper.m_PlayerControl; }
public void Enable() { Get().Enable(); }
public void Disable() { Get().Disable(); }
@@ -336,6 +370,9 @@ namespace Input
@Climb.started -= m_Wrapper.m_PlayerControlActionsCallbackInterface.OnClimb;
@Climb.performed -= m_Wrapper.m_PlayerControlActionsCallbackInterface.OnClimb;
@Climb.canceled -= m_Wrapper.m_PlayerControlActionsCallbackInterface.OnClimb;
@Pause.started -= m_Wrapper.m_PlayerControlActionsCallbackInterface.OnPause;
@Pause.performed -= m_Wrapper.m_PlayerControlActionsCallbackInterface.OnPause;
@Pause.canceled -= m_Wrapper.m_PlayerControlActionsCallbackInterface.OnPause;
}
m_Wrapper.m_PlayerControlActionsCallbackInterface = instance;
if (instance != null)
@@ -352,6 +389,9 @@ namespace Input
@Climb.started += instance.OnClimb;
@Climb.performed += instance.OnClimb;
@Climb.canceled += instance.OnClimb;
@Pause.started += instance.OnPause;
@Pause.performed += instance.OnPause;
@Pause.canceled += instance.OnPause;
}
}
}
@@ -380,6 +420,7 @@ namespace Input
void OnJump(InputAction.CallbackContext context);
void OnInteract(InputAction.CallbackContext context);
void OnClimb(InputAction.CallbackContext context);
void OnPause(InputAction.CallbackContext context);
}
}
}

View File

@@ -40,6 +40,15 @@
"processors": "",
"interactions": "",
"initialStateCheck": false
},
{
"name": "Pause",
"type": "Button",
"id": "b110facd-253d-41ce-9de7-b589dc48cfc6",
"expectedControlType": "Button",
"processors": "",
"interactions": "",
"initialStateCheck": false
}
],
"bindings": [
@@ -185,6 +194,28 @@
"action": "Climb",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "6a01ec66-e7a4-426a-8ee4-977d456b200c",
"path": "<Gamepad>/start",
"interactions": "",
"processors": "",
"groups": "Controller",
"action": "Pause",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "279efb3d-768d-49fd-91f5-c74ebe08c880",
"path": "<Keyboard>/escape",
"interactions": "",
"processors": "",
"groups": "KeyBoard",
"action": "Pause",
"isComposite": false,
"isPartOfComposite": false
}
]
}