Add controller control
This commit is contained in:
parent
7ead561296
commit
7cebbfc42b
@ -31,7 +31,7 @@ public partial class @GameInputs: IInputActionCollection2, IDisposable
|
|||||||
""name"": ""Movement"",
|
""name"": ""Movement"",
|
||||||
""type"": ""Value"",
|
""type"": ""Value"",
|
||||||
""id"": ""39923aa3-9a9e-4368-8ceb-bebf8ec65530"",
|
""id"": ""39923aa3-9a9e-4368-8ceb-bebf8ec65530"",
|
||||||
""expectedControlType"": ""Axis"",
|
""expectedControlType"": ""Vector2"",
|
||||||
""processors"": """",
|
""processors"": """",
|
||||||
""interactions"": """",
|
""interactions"": """",
|
||||||
""initialStateCheck"": true
|
""initialStateCheck"": true
|
||||||
@ -42,7 +42,7 @@ public partial class @GameInputs: IInputActionCollection2, IDisposable
|
|||||||
""id"": ""436a199c-9091-4d2b-a0e8-afd8675d45f0"",
|
""id"": ""436a199c-9091-4d2b-a0e8-afd8675d45f0"",
|
||||||
""expectedControlType"": ""Button"",
|
""expectedControlType"": ""Button"",
|
||||||
""processors"": """",
|
""processors"": """",
|
||||||
""interactions"": """",
|
""interactions"": ""Press"",
|
||||||
""initialStateCheck"": false
|
""initialStateCheck"": false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -58,10 +58,21 @@ public partial class @GameInputs: IInputActionCollection2, IDisposable
|
|||||||
""isComposite"": false,
|
""isComposite"": false,
|
||||||
""isPartOfComposite"": false
|
""isPartOfComposite"": false
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
""name"": """",
|
||||||
|
""id"": ""33b2a668-c24d-4232-ac55-ff4e3bb2c69e"",
|
||||||
|
""path"": ""<Gamepad>/buttonSouth"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": """",
|
||||||
|
""action"": ""Jump"",
|
||||||
|
""isComposite"": false,
|
||||||
|
""isPartOfComposite"": false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
""name"": ""AD"",
|
""name"": ""AD"",
|
||||||
""id"": ""3ee35364-2c5b-43ec-bcfe-5cceafd1bf45"",
|
""id"": ""4c9ec82f-24c0-457d-910e-feb2d226f3a7"",
|
||||||
""path"": ""1DAxis"",
|
""path"": ""2DVector(mode=1)"",
|
||||||
""interactions"": """",
|
""interactions"": """",
|
||||||
""processors"": """",
|
""processors"": """",
|
||||||
""groups"": """",
|
""groups"": """",
|
||||||
@ -70,8 +81,30 @@ public partial class @GameInputs: IInputActionCollection2, IDisposable
|
|||||||
""isPartOfComposite"": false
|
""isPartOfComposite"": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
""name"": ""negative"",
|
""name"": ""up"",
|
||||||
""id"": ""c9f367f7-68bb-47d3-aa78-d9d579a69db0"",
|
""id"": ""84119425-90ec-4c8f-b441-53906d174e00"",
|
||||||
|
""path"": """",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": """",
|
||||||
|
""action"": ""Movement"",
|
||||||
|
""isComposite"": false,
|
||||||
|
""isPartOfComposite"": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""down"",
|
||||||
|
""id"": ""c1460f5a-ec6b-455b-a677-ebb7c53419fd"",
|
||||||
|
""path"": """",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": """",
|
||||||
|
""action"": ""Movement"",
|
||||||
|
""isComposite"": false,
|
||||||
|
""isPartOfComposite"": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": ""left"",
|
||||||
|
""id"": ""7fc0be6f-4d53-4398-b950-60f5c281ac36"",
|
||||||
""path"": ""<Keyboard>/a"",
|
""path"": ""<Keyboard>/a"",
|
||||||
""interactions"": """",
|
""interactions"": """",
|
||||||
""processors"": """",
|
""processors"": """",
|
||||||
@ -81,8 +114,8 @@ public partial class @GameInputs: IInputActionCollection2, IDisposable
|
|||||||
""isPartOfComposite"": true
|
""isPartOfComposite"": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
""name"": ""positive"",
|
""name"": ""right"",
|
||||||
""id"": ""1b04a4aa-9990-4bcd-97b2-b98061031ba4"",
|
""id"": ""17a08552-5a32-446d-b856-078d633a06ae"",
|
||||||
""path"": ""<Keyboard>/d"",
|
""path"": ""<Keyboard>/d"",
|
||||||
""interactions"": """",
|
""interactions"": """",
|
||||||
""processors"": """",
|
""processors"": """",
|
||||||
@ -90,6 +123,17 @@ public partial class @GameInputs: IInputActionCollection2, IDisposable
|
|||||||
""action"": ""Movement"",
|
""action"": ""Movement"",
|
||||||
""isComposite"": false,
|
""isComposite"": false,
|
||||||
""isPartOfComposite"": true
|
""isPartOfComposite"": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""name"": """",
|
||||||
|
""id"": ""3c53f63f-69a0-4bea-b572-f92acc6c6d98"",
|
||||||
|
""path"": ""<Gamepad>/leftStick"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": ""StickDeadzone"",
|
||||||
|
""groups"": """",
|
||||||
|
""action"": ""Movement"",
|
||||||
|
""isComposite"": false,
|
||||||
|
""isPartOfComposite"": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
"name": "Movement",
|
"name": "Movement",
|
||||||
"type": "Value",
|
"type": "Value",
|
||||||
"id": "39923aa3-9a9e-4368-8ceb-bebf8ec65530",
|
"id": "39923aa3-9a9e-4368-8ceb-bebf8ec65530",
|
||||||
"expectedControlType": "Axis",
|
"expectedControlType": "Vector2",
|
||||||
"processors": "",
|
"processors": "",
|
||||||
"interactions": "",
|
"interactions": "",
|
||||||
"initialStateCheck": true
|
"initialStateCheck": true
|
||||||
@ -20,7 +20,7 @@
|
|||||||
"id": "436a199c-9091-4d2b-a0e8-afd8675d45f0",
|
"id": "436a199c-9091-4d2b-a0e8-afd8675d45f0",
|
||||||
"expectedControlType": "Button",
|
"expectedControlType": "Button",
|
||||||
"processors": "",
|
"processors": "",
|
||||||
"interactions": "",
|
"interactions": "Press",
|
||||||
"initialStateCheck": false
|
"initialStateCheck": false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -36,10 +36,21 @@
|
|||||||
"isComposite": false,
|
"isComposite": false,
|
||||||
"isPartOfComposite": false
|
"isPartOfComposite": false
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "",
|
||||||
|
"id": "33b2a668-c24d-4232-ac55-ff4e3bb2c69e",
|
||||||
|
"path": "<Gamepad>/buttonSouth",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "Jump",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "AD",
|
"name": "AD",
|
||||||
"id": "3ee35364-2c5b-43ec-bcfe-5cceafd1bf45",
|
"id": "4c9ec82f-24c0-457d-910e-feb2d226f3a7",
|
||||||
"path": "1DAxis",
|
"path": "2DVector(mode=1)",
|
||||||
"interactions": "",
|
"interactions": "",
|
||||||
"processors": "",
|
"processors": "",
|
||||||
"groups": "",
|
"groups": "",
|
||||||
@ -48,8 +59,30 @@
|
|||||||
"isPartOfComposite": false
|
"isPartOfComposite": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "negative",
|
"name": "up",
|
||||||
"id": "c9f367f7-68bb-47d3-aa78-d9d579a69db0",
|
"id": "84119425-90ec-4c8f-b441-53906d174e00",
|
||||||
|
"path": "",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "Movement",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "down",
|
||||||
|
"id": "c1460f5a-ec6b-455b-a677-ebb7c53419fd",
|
||||||
|
"path": "",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "Movement",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "left",
|
||||||
|
"id": "7fc0be6f-4d53-4398-b950-60f5c281ac36",
|
||||||
"path": "<Keyboard>/a",
|
"path": "<Keyboard>/a",
|
||||||
"interactions": "",
|
"interactions": "",
|
||||||
"processors": "",
|
"processors": "",
|
||||||
@ -59,8 +92,8 @@
|
|||||||
"isPartOfComposite": true
|
"isPartOfComposite": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "positive",
|
"name": "right",
|
||||||
"id": "1b04a4aa-9990-4bcd-97b2-b98061031ba4",
|
"id": "17a08552-5a32-446d-b856-078d633a06ae",
|
||||||
"path": "<Keyboard>/d",
|
"path": "<Keyboard>/d",
|
||||||
"interactions": "",
|
"interactions": "",
|
||||||
"processors": "",
|
"processors": "",
|
||||||
@ -68,6 +101,17 @@
|
|||||||
"action": "Movement",
|
"action": "Movement",
|
||||||
"isComposite": false,
|
"isComposite": false,
|
||||||
"isPartOfComposite": true
|
"isPartOfComposite": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "",
|
||||||
|
"id": "3c53f63f-69a0-4bea-b572-f92acc6c6d98",
|
||||||
|
"path": "<Gamepad>/leftStick",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "StickDeadzone",
|
||||||
|
"groups": "",
|
||||||
|
"action": "Movement",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -48,7 +48,7 @@ public class PlayerInputHandler : MonoBehaviour
|
|||||||
|
|
||||||
private void ProcessInput()
|
private void ProcessInput()
|
||||||
{
|
{
|
||||||
MoveAxis = _input.Player.Movement.ReadValue<float>();
|
MoveAxis = _input.Player.Movement.ReadValue<Vector2>().x;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ClearInput()
|
private void ClearInput()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user