new movement system work

This commit is contained in:
Vova
2024-01-04 09:59:29 +02:00
parent 72c24ac8a7
commit 6ac52e1665
3 changed files with 121 additions and 1 deletions
+55
View File
@@ -92,6 +92,61 @@ public partial class @InputActions: IInputActionCollection2, IDisposable
""action"": ""Movement"", ""action"": ""Movement"",
""isComposite"": false, ""isComposite"": false,
""isPartOfComposite"": true ""isPartOfComposite"": true
},
{
""name"": ""2D Vector"",
""id"": ""2bc3f525-a5a8-4d0f-a679-5b0d8dcff168"",
""path"": ""2DVector"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""Movement"",
""isComposite"": true,
""isPartOfComposite"": false
},
{
""name"": ""up"",
""id"": ""a7ed1fe9-4819-4055-840d-284172ef0cba"",
""path"": ""<Gamepad>/leftStick/up"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""Movement"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""down"",
""id"": ""f1b7a29e-55b7-4a22-b2db-fceee993e456"",
""path"": ""<Gamepad>/leftStick/down"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""Movement"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""left"",
""id"": ""e1be144e-9344-47d0-ad6a-4160bb893bcb"",
""path"": ""<Gamepad>/leftStick/left"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""Movement"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""right"",
""id"": ""150c31e4-d3d8-4d14-9f07-3185561a86ba"",
""path"": ""<Gamepad>/leftStick/right"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""Movement"",
""isComposite"": false,
""isPartOfComposite"": true
} }
] ]
} }
+55
View File
@@ -70,6 +70,61 @@
"action": "Movement", "action": "Movement",
"isComposite": false, "isComposite": false,
"isPartOfComposite": true "isPartOfComposite": true
},
{
"name": "2D Vector",
"id": "2bc3f525-a5a8-4d0f-a679-5b0d8dcff168",
"path": "2DVector",
"interactions": "",
"processors": "",
"groups": "",
"action": "Movement",
"isComposite": true,
"isPartOfComposite": false
},
{
"name": "up",
"id": "a7ed1fe9-4819-4055-840d-284172ef0cba",
"path": "<Gamepad>/leftStick/up",
"interactions": "",
"processors": "",
"groups": "",
"action": "Movement",
"isComposite": false,
"isPartOfComposite": true
},
{
"name": "down",
"id": "f1b7a29e-55b7-4a22-b2db-fceee993e456",
"path": "<Gamepad>/leftStick/down",
"interactions": "",
"processors": "",
"groups": "",
"action": "Movement",
"isComposite": false,
"isPartOfComposite": true
},
{
"name": "left",
"id": "e1be144e-9344-47d0-ad6a-4160bb893bcb",
"path": "<Gamepad>/leftStick/left",
"interactions": "",
"processors": "",
"groups": "",
"action": "Movement",
"isComposite": false,
"isPartOfComposite": true
},
{
"name": "right",
"id": "150c31e4-d3d8-4d14-9f07-3185561a86ba",
"path": "<Gamepad>/leftStick/right",
"interactions": "",
"processors": "",
"groups": "",
"action": "Movement",
"isComposite": false,
"isPartOfComposite": true
} }
] ]
} }
+11 -1
View File
@@ -30,7 +30,7 @@ public class Player : Character
public event EventHandler<TreasureType> OnPlayerTakeItem; public event EventHandler<TreasureType> OnPlayerTakeItem;
public InputActions _inputActions = new InputActions(); private InputActions _inputActions;
private void Awake() private void Awake()
{ {
@@ -43,9 +43,19 @@ public class Player : Character
PlayerPrefs.SetString("lastExitName", string.Empty); PlayerPrefs.SetString("lastExitName", string.Empty);
Instance = this; Instance = this;
DontDestroyOnLoad(gameObject); DontDestroyOnLoad(gameObject);
_inputActions = new InputActions();
}
private void OnEnable()
{
_inputActions.Enable(); _inputActions.Enable();
} }
private void OnDisable()
{
_inputActions.Disable();
}
public void AddCoin() public void AddCoin()
{ {
_totalCoins++; _totalCoins++;