Added Orientation enum and climbing input handling

This commit is contained in:
OverflowNarhoym
2022-02-22 18:39:19 +01:00
parent da4fc01a50
commit 557496897a
5 changed files with 569 additions and 663 deletions

View File

@@ -55,6 +55,15 @@ namespace Input
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
},
{
""name"": ""Climb"",
""type"": ""Button"",
""id"": ""e2e43254-ce84-4db9-84e9-cad9af922a9f"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
}
],
""bindings"": [
@@ -149,7 +158,7 @@ namespace Input
{
""name"": """",
""id"": ""4eb9a209-b978-4daf-927a-2f013348d294"",
""path"": ""<Keyboard>/z"",
""path"": ""<Keyboard>/e"",
""interactions"": """",
""processors"": """",
""groups"": ""KeyBoard"",
@@ -167,6 +176,39 @@ namespace Input
""action"": ""Interact"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""d690447f-c6c0-4ce5-aca1-c92e65d0ccc6"",
""path"": ""<Gamepad>/leftTrigger"",
""interactions"": """",
""processors"": """",
""groups"": ""Controller"",
""action"": ""Climb"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""010bad3a-3b2d-4a15-aec1-e927c7b749a1"",
""path"": ""<Gamepad>/rightTrigger"",
""interactions"": """",
""processors"": """",
""groups"": ""Controller"",
""action"": ""Climb"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""02b2ecde-c402-4840-9246-2bcd32b085de"",
""path"": ""<Keyboard>/x"",
""interactions"": """",
""processors"": """",
""groups"": ""KeyBoard"",
""action"": ""Climb"",
""isComposite"": false,
""isPartOfComposite"": false
}
]
}
@@ -201,6 +243,7 @@ namespace Input
m_PlayerControl_Move = m_PlayerControl.FindAction("Move", throwIfNotFound: true);
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);
}
public void Dispose()
@@ -263,6 +306,7 @@ namespace Input
private readonly InputAction m_PlayerControl_Move;
private readonly InputAction m_PlayerControl_Jump;
private readonly InputAction m_PlayerControl_Interact;
private readonly InputAction m_PlayerControl_Climb;
public struct PlayerControlActions
{
private @PlayerInput m_Wrapper;
@@ -270,6 +314,7 @@ namespace Input
public InputAction @Move => m_Wrapper.m_PlayerControl_Move;
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 InputActionMap Get() { return m_Wrapper.m_PlayerControl; }
public void Enable() { Get().Enable(); }
public void Disable() { Get().Disable(); }
@@ -288,6 +333,9 @@ namespace Input
@Interact.started -= m_Wrapper.m_PlayerControlActionsCallbackInterface.OnInteract;
@Interact.performed -= m_Wrapper.m_PlayerControlActionsCallbackInterface.OnInteract;
@Interact.canceled -= m_Wrapper.m_PlayerControlActionsCallbackInterface.OnInteract;
@Climb.started -= m_Wrapper.m_PlayerControlActionsCallbackInterface.OnClimb;
@Climb.performed -= m_Wrapper.m_PlayerControlActionsCallbackInterface.OnClimb;
@Climb.canceled -= m_Wrapper.m_PlayerControlActionsCallbackInterface.OnClimb;
}
m_Wrapper.m_PlayerControlActionsCallbackInterface = instance;
if (instance != null)
@@ -301,6 +349,9 @@ namespace Input
@Interact.started += instance.OnInteract;
@Interact.performed += instance.OnInteract;
@Interact.canceled += instance.OnInteract;
@Climb.started += instance.OnClimb;
@Climb.performed += instance.OnClimb;
@Climb.canceled += instance.OnClimb;
}
}
}
@@ -328,6 +379,7 @@ namespace Input
void OnMove(InputAction.CallbackContext context);
void OnJump(InputAction.CallbackContext context);
void OnInteract(InputAction.CallbackContext context);
void OnClimb(InputAction.CallbackContext context);
}
}
}

View File

@@ -31,6 +31,15 @@
"processors": "",
"interactions": "",
"initialStateCheck": false
},
{
"name": "Climb",
"type": "Button",
"id": "e2e43254-ce84-4db9-84e9-cad9af922a9f",
"expectedControlType": "Button",
"processors": "",
"interactions": "",
"initialStateCheck": false
}
],
"bindings": [
@@ -125,7 +134,7 @@
{
"name": "",
"id": "4eb9a209-b978-4daf-927a-2f013348d294",
"path": "<Keyboard>/z",
"path": "<Keyboard>/e",
"interactions": "",
"processors": "",
"groups": "KeyBoard",
@@ -143,6 +152,39 @@
"action": "Interact",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "d690447f-c6c0-4ce5-aca1-c92e65d0ccc6",
"path": "<Gamepad>/leftTrigger",
"interactions": "",
"processors": "",
"groups": "Controller",
"action": "Climb",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "010bad3a-3b2d-4a15-aec1-e927c7b749a1",
"path": "<Gamepad>/rightTrigger",
"interactions": "",
"processors": "",
"groups": "Controller",
"action": "Climb",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "02b2ecde-c402-4840-9246-2bcd32b085de",
"path": "<Keyboard>/x",
"interactions": "",
"processors": "",
"groups": "KeyBoard",
"action": "Climb",
"isComposite": false,
"isPartOfComposite": false
}
]
}