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

Commit

Permalink
Player moving
Browse files Browse the repository at this point in the history
  • Loading branch information
Team-on committed Jul 10, 2021
1 parent af352f7 commit faf2622
Show file tree
Hide file tree
Showing 23 changed files with 1,865 additions and 2,833 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,21 @@ public @PlayerInputActions()
""interactions"": """"
},
{
""name"": ""Look"",
""name"": ""LookMouse"",
""type"": ""Value"",
""id"": ""15fcc27f-7476-491b-bf84-3fbc33a9605b"",
""expectedControlType"": ""Vector2"",
""processors"": """",
""interactions"": """"
},
{
""name"": ""LookGamepad"",
""type"": ""Value"",
""id"": ""1e3f5914-be6f-478c-bca9-2a8c4d3749eb"",
""expectedControlType"": ""Vector2"",
""processors"": """",
""interactions"": """"
},
{
""name"": ""Fire"",
""type"": ""Button"",
Expand Down Expand Up @@ -166,44 +174,44 @@ public @PlayerInputActions()
{
""name"": """",
""id"": ""8c8e490b-c610-4785-884f-f04217b23ca4"",
""path"": ""<Pointer>/delta"",
""path"": ""<Pointer>/position"",
""interactions"": """",
""processors"": """",
""groups"": "";Keyboard&Mouse;Touch"",
""action"": ""Look"",
""action"": ""LookMouse"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""c1f7a91b-d0fd-4a62-997e-7fb9b69bf235"",
""path"": ""<Gamepad>/rightStick"",
""id"": ""05f6913d-c316-48b2-a6bb-e225f14c7960"",
""path"": ""<Mouse>/leftButton"",
""interactions"": """",
""processors"": """",
""groups"": "";Gamepad"",
""action"": ""Look"",
""groups"": "";Keyboard&Mouse"",
""action"": ""Fire"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""05f6913d-c316-48b2-a6bb-e225f14c7960"",
""path"": ""<Mouse>/leftButton"",
""id"": ""143bb1cd-cc10-4eca-a2f0-a3664166fe91"",
""path"": ""<Gamepad>/rightTrigger"",
""interactions"": """",
""processors"": """",
""groups"": "";Keyboard&Mouse"",
""groups"": "";Gamepad"",
""action"": ""Fire"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""143bb1cd-cc10-4eca-a2f0-a3664166fe91"",
""path"": ""<Gamepad>/rightTrigger"",
""id"": ""559ec0f7-639c-49ba-a5fa-bb65f090a186"",
""path"": ""<Gamepad>/rightStick"",
""interactions"": """",
""processors"": """",
""groups"": "";Gamepad"",
""action"": ""Fire"",
""action"": ""LookGamepad"",
""isComposite"": false,
""isPartOfComposite"": false
}
Expand Down Expand Up @@ -806,7 +814,8 @@ public @PlayerInputActions()
// Player
m_Player = asset.FindActionMap("Player", throwIfNotFound: true);
m_Player_Move = m_Player.FindAction("Move", throwIfNotFound: true);
m_Player_Look = m_Player.FindAction("Look", throwIfNotFound: true);
m_Player_LookMouse = m_Player.FindAction("LookMouse", throwIfNotFound: true);
m_Player_LookGamepad = m_Player.FindAction("LookGamepad", throwIfNotFound: true);
m_Player_Fire = m_Player.FindAction("Fire", throwIfNotFound: true);
// UI
m_UI = asset.FindActionMap("UI", throwIfNotFound: true);
Expand Down Expand Up @@ -884,14 +893,16 @@ public int FindBinding(InputBinding bindingMask, out InputAction action)
private readonly InputActionMap m_Player;
private IPlayerActions m_PlayerActionsCallbackInterface;
private readonly InputAction m_Player_Move;
private readonly InputAction m_Player_Look;
private readonly InputAction m_Player_LookMouse;
private readonly InputAction m_Player_LookGamepad;
private readonly InputAction m_Player_Fire;
public struct PlayerActions
{
private @PlayerInputActions m_Wrapper;
public PlayerActions(@PlayerInputActions wrapper) { m_Wrapper = wrapper; }
public InputAction @Move => m_Wrapper.m_Player_Move;
public InputAction @Look => m_Wrapper.m_Player_Look;
public InputAction @LookMouse => m_Wrapper.m_Player_LookMouse;
public InputAction @LookGamepad => m_Wrapper.m_Player_LookGamepad;
public InputAction @Fire => m_Wrapper.m_Player_Fire;
public InputActionMap Get() { return m_Wrapper.m_Player; }
public void Enable() { Get().Enable(); }
Expand All @@ -905,9 +916,12 @@ public void SetCallbacks(IPlayerActions instance)
@Move.started -= m_Wrapper.m_PlayerActionsCallbackInterface.OnMove;
@Move.performed -= m_Wrapper.m_PlayerActionsCallbackInterface.OnMove;
@Move.canceled -= m_Wrapper.m_PlayerActionsCallbackInterface.OnMove;
@Look.started -= m_Wrapper.m_PlayerActionsCallbackInterface.OnLook;
@Look.performed -= m_Wrapper.m_PlayerActionsCallbackInterface.OnLook;
@Look.canceled -= m_Wrapper.m_PlayerActionsCallbackInterface.OnLook;
@LookMouse.started -= m_Wrapper.m_PlayerActionsCallbackInterface.OnLookMouse;
@LookMouse.performed -= m_Wrapper.m_PlayerActionsCallbackInterface.OnLookMouse;
@LookMouse.canceled -= m_Wrapper.m_PlayerActionsCallbackInterface.OnLookMouse;
@LookGamepad.started -= m_Wrapper.m_PlayerActionsCallbackInterface.OnLookGamepad;
@LookGamepad.performed -= m_Wrapper.m_PlayerActionsCallbackInterface.OnLookGamepad;
@LookGamepad.canceled -= m_Wrapper.m_PlayerActionsCallbackInterface.OnLookGamepad;
@Fire.started -= m_Wrapper.m_PlayerActionsCallbackInterface.OnFire;
@Fire.performed -= m_Wrapper.m_PlayerActionsCallbackInterface.OnFire;
@Fire.canceled -= m_Wrapper.m_PlayerActionsCallbackInterface.OnFire;
Expand All @@ -918,9 +932,12 @@ public void SetCallbacks(IPlayerActions instance)
@Move.started += instance.OnMove;
@Move.performed += instance.OnMove;
@Move.canceled += instance.OnMove;
@Look.started += instance.OnLook;
@Look.performed += instance.OnLook;
@Look.canceled += instance.OnLook;
@LookMouse.started += instance.OnLookMouse;
@LookMouse.performed += instance.OnLookMouse;
@LookMouse.canceled += instance.OnLookMouse;
@LookGamepad.started += instance.OnLookGamepad;
@LookGamepad.performed += instance.OnLookGamepad;
@LookGamepad.canceled += instance.OnLookGamepad;
@Fire.started += instance.OnFire;
@Fire.performed += instance.OnFire;
@Fire.canceled += instance.OnFire;
Expand Down Expand Up @@ -1104,7 +1121,8 @@ public InputControlScheme TouchScheme
public interface IPlayerActions
{
void OnMove(InputAction.CallbackContext context);
void OnLook(InputAction.CallbackContext context);
void OnLookMouse(InputAction.CallbackContext context);
void OnLookGamepad(InputAction.CallbackContext context);
void OnFire(InputAction.CallbackContext context);
}
public interface IUIActions
Expand Down
Loading

0 comments on commit faf2622

Please sign in to comment.