Skip to content
This repository was archived by the owner on Oct 26, 2021. It is now read-only.

Commit faf2622

Browse files
committed
Player moving
1 parent af352f7 commit faf2622

23 files changed

+1865
-2833
lines changed

StepicoGameJam/Assets/Plugins/GameTemplate/Scripts/Input/PlayerInputActions.cs

+41-23
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,21 @@ public @PlayerInputActions()
3636
""interactions"": """"
3737
},
3838
{
39-
""name"": ""Look"",
39+
""name"": ""LookMouse"",
4040
""type"": ""Value"",
4141
""id"": ""15fcc27f-7476-491b-bf84-3fbc33a9605b"",
4242
""expectedControlType"": ""Vector2"",
4343
""processors"": """",
4444
""interactions"": """"
4545
},
46+
{
47+
""name"": ""LookGamepad"",
48+
""type"": ""Value"",
49+
""id"": ""1e3f5914-be6f-478c-bca9-2a8c4d3749eb"",
50+
""expectedControlType"": ""Vector2"",
51+
""processors"": """",
52+
""interactions"": """"
53+
},
4654
{
4755
""name"": ""Fire"",
4856
""type"": ""Button"",
@@ -166,44 +174,44 @@ public @PlayerInputActions()
166174
{
167175
""name"": """",
168176
""id"": ""8c8e490b-c610-4785-884f-f04217b23ca4"",
169-
""path"": ""<Pointer>/delta"",
177+
""path"": ""<Pointer>/position"",
170178
""interactions"": """",
171179
""processors"": """",
172180
""groups"": "";Keyboard&Mouse;Touch"",
173-
""action"": ""Look"",
181+
""action"": ""LookMouse"",
174182
""isComposite"": false,
175183
""isPartOfComposite"": false
176184
},
177185
{
178186
""name"": """",
179-
""id"": ""c1f7a91b-d0fd-4a62-997e-7fb9b69bf235"",
180-
""path"": ""<Gamepad>/rightStick"",
187+
""id"": ""05f6913d-c316-48b2-a6bb-e225f14c7960"",
188+
""path"": ""<Mouse>/leftButton"",
181189
""interactions"": """",
182190
""processors"": """",
183-
""groups"": "";Gamepad"",
184-
""action"": ""Look"",
191+
""groups"": "";Keyboard&Mouse"",
192+
""action"": ""Fire"",
185193
""isComposite"": false,
186194
""isPartOfComposite"": false
187195
},
188196
{
189197
""name"": """",
190-
""id"": ""05f6913d-c316-48b2-a6bb-e225f14c7960"",
191-
""path"": ""<Mouse>/leftButton"",
198+
""id"": ""143bb1cd-cc10-4eca-a2f0-a3664166fe91"",
199+
""path"": ""<Gamepad>/rightTrigger"",
192200
""interactions"": """",
193201
""processors"": """",
194-
""groups"": "";Keyboard&Mouse"",
202+
""groups"": "";Gamepad"",
195203
""action"": ""Fire"",
196204
""isComposite"": false,
197205
""isPartOfComposite"": false
198206
},
199207
{
200208
""name"": """",
201-
""id"": ""143bb1cd-cc10-4eca-a2f0-a3664166fe91"",
202-
""path"": ""<Gamepad>/rightTrigger"",
209+
""id"": ""559ec0f7-639c-49ba-a5fa-bb65f090a186"",
210+
""path"": ""<Gamepad>/rightStick"",
203211
""interactions"": """",
204212
""processors"": """",
205213
""groups"": "";Gamepad"",
206-
""action"": ""Fire"",
214+
""action"": ""LookGamepad"",
207215
""isComposite"": false,
208216
""isPartOfComposite"": false
209217
}
@@ -806,7 +814,8 @@ public @PlayerInputActions()
806814
// Player
807815
m_Player = asset.FindActionMap("Player", throwIfNotFound: true);
808816
m_Player_Move = m_Player.FindAction("Move", throwIfNotFound: true);
809-
m_Player_Look = m_Player.FindAction("Look", throwIfNotFound: true);
817+
m_Player_LookMouse = m_Player.FindAction("LookMouse", throwIfNotFound: true);
818+
m_Player_LookGamepad = m_Player.FindAction("LookGamepad", throwIfNotFound: true);
810819
m_Player_Fire = m_Player.FindAction("Fire", throwIfNotFound: true);
811820
// UI
812821
m_UI = asset.FindActionMap("UI", throwIfNotFound: true);
@@ -884,14 +893,16 @@ public int FindBinding(InputBinding bindingMask, out InputAction action)
884893
private readonly InputActionMap m_Player;
885894
private IPlayerActions m_PlayerActionsCallbackInterface;
886895
private readonly InputAction m_Player_Move;
887-
private readonly InputAction m_Player_Look;
896+
private readonly InputAction m_Player_LookMouse;
897+
private readonly InputAction m_Player_LookGamepad;
888898
private readonly InputAction m_Player_Fire;
889899
public struct PlayerActions
890900
{
891901
private @PlayerInputActions m_Wrapper;
892902
public PlayerActions(@PlayerInputActions wrapper) { m_Wrapper = wrapper; }
893903
public InputAction @Move => m_Wrapper.m_Player_Move;
894-
public InputAction @Look => m_Wrapper.m_Player_Look;
904+
public InputAction @LookMouse => m_Wrapper.m_Player_LookMouse;
905+
public InputAction @LookGamepad => m_Wrapper.m_Player_LookGamepad;
895906
public InputAction @Fire => m_Wrapper.m_Player_Fire;
896907
public InputActionMap Get() { return m_Wrapper.m_Player; }
897908
public void Enable() { Get().Enable(); }
@@ -905,9 +916,12 @@ public void SetCallbacks(IPlayerActions instance)
905916
@Move.started -= m_Wrapper.m_PlayerActionsCallbackInterface.OnMove;
906917
@Move.performed -= m_Wrapper.m_PlayerActionsCallbackInterface.OnMove;
907918
@Move.canceled -= m_Wrapper.m_PlayerActionsCallbackInterface.OnMove;
908-
@Look.started -= m_Wrapper.m_PlayerActionsCallbackInterface.OnLook;
909-
@Look.performed -= m_Wrapper.m_PlayerActionsCallbackInterface.OnLook;
910-
@Look.canceled -= m_Wrapper.m_PlayerActionsCallbackInterface.OnLook;
919+
@LookMouse.started -= m_Wrapper.m_PlayerActionsCallbackInterface.OnLookMouse;
920+
@LookMouse.performed -= m_Wrapper.m_PlayerActionsCallbackInterface.OnLookMouse;
921+
@LookMouse.canceled -= m_Wrapper.m_PlayerActionsCallbackInterface.OnLookMouse;
922+
@LookGamepad.started -= m_Wrapper.m_PlayerActionsCallbackInterface.OnLookGamepad;
923+
@LookGamepad.performed -= m_Wrapper.m_PlayerActionsCallbackInterface.OnLookGamepad;
924+
@LookGamepad.canceled -= m_Wrapper.m_PlayerActionsCallbackInterface.OnLookGamepad;
911925
@Fire.started -= m_Wrapper.m_PlayerActionsCallbackInterface.OnFire;
912926
@Fire.performed -= m_Wrapper.m_PlayerActionsCallbackInterface.OnFire;
913927
@Fire.canceled -= m_Wrapper.m_PlayerActionsCallbackInterface.OnFire;
@@ -918,9 +932,12 @@ public void SetCallbacks(IPlayerActions instance)
918932
@Move.started += instance.OnMove;
919933
@Move.performed += instance.OnMove;
920934
@Move.canceled += instance.OnMove;
921-
@Look.started += instance.OnLook;
922-
@Look.performed += instance.OnLook;
923-
@Look.canceled += instance.OnLook;
935+
@LookMouse.started += instance.OnLookMouse;
936+
@LookMouse.performed += instance.OnLookMouse;
937+
@LookMouse.canceled += instance.OnLookMouse;
938+
@LookGamepad.started += instance.OnLookGamepad;
939+
@LookGamepad.performed += instance.OnLookGamepad;
940+
@LookGamepad.canceled += instance.OnLookGamepad;
924941
@Fire.started += instance.OnFire;
925942
@Fire.performed += instance.OnFire;
926943
@Fire.canceled += instance.OnFire;
@@ -1104,7 +1121,8 @@ public InputControlScheme TouchScheme
11041121
public interface IPlayerActions
11051122
{
11061123
void OnMove(InputAction.CallbackContext context);
1107-
void OnLook(InputAction.CallbackContext context);
1124+
void OnLookMouse(InputAction.CallbackContext context);
1125+
void OnLookGamepad(InputAction.CallbackContext context);
11081126
void OnFire(InputAction.CallbackContext context);
11091127
}
11101128
public interface IUIActions

0 commit comments

Comments
 (0)