feat():大改前的提交,这个版本保存了所有冗余的代码
This commit is contained in:
@@ -15,7 +15,7 @@ using System.Collections.Generic;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.InputSystem.Utilities;
|
||||
|
||||
namespace Input
|
||||
namespace Script.Gameplay.Input
|
||||
{
|
||||
public partial class @PlayerInputActions: IInputActionCollection2, IDisposable
|
||||
{
|
||||
@@ -64,6 +64,33 @@ namespace Input
|
||||
""processors"": """",
|
||||
""interactions"": """",
|
||||
""initialStateCheck"": false
|
||||
},
|
||||
{
|
||||
""name"": ""Pause"",
|
||||
""type"": ""Button"",
|
||||
""id"": ""822c2284-94e3-4636-894c-adfe85ac467d"",
|
||||
""expectedControlType"": """",
|
||||
""processors"": """",
|
||||
""interactions"": """",
|
||||
""initialStateCheck"": false
|
||||
},
|
||||
{
|
||||
""name"": ""SwitchWatchMode"",
|
||||
""type"": ""Button"",
|
||||
""id"": ""73ffcbfd-15ae-4580-99c4-d7d06ff13bb6"",
|
||||
""expectedControlType"": """",
|
||||
""processors"": """",
|
||||
""interactions"": """",
|
||||
""initialStateCheck"": false
|
||||
},
|
||||
{
|
||||
""name"": ""Edit"",
|
||||
""type"": ""Button"",
|
||||
""id"": ""20a9157a-918b-42f1-80b1-9e014426068e"",
|
||||
""expectedControlType"": """",
|
||||
""processors"": """",
|
||||
""interactions"": """",
|
||||
""initialStateCheck"": false
|
||||
}
|
||||
],
|
||||
""bindings"": [
|
||||
@@ -165,6 +192,39 @@ namespace Input
|
||||
""action"": ""Interact"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""943ba523-b024-410e-a250-735a5ffdf786"",
|
||||
""path"": ""<Keyboard>/escape"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": """",
|
||||
""action"": ""Pause"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""47af0242-9835-4b1a-82c8-e3fc32489870"",
|
||||
""path"": ""<Keyboard>/tab"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": """",
|
||||
""action"": ""SwitchWatchMode"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""9e9bf8ec-8b3e-4230-a10c-ae874395711a"",
|
||||
""path"": ""<Keyboard>/x"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": """",
|
||||
""action"": ""Edit"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -177,6 +237,9 @@ namespace Input
|
||||
m_Player_Look = m_Player.FindAction("Look", throwIfNotFound: true);
|
||||
m_Player_Jump = m_Player.FindAction("Jump", throwIfNotFound: true);
|
||||
m_Player_Interact = m_Player.FindAction("Interact", throwIfNotFound: true);
|
||||
m_Player_Pause = m_Player.FindAction("Pause", throwIfNotFound: true);
|
||||
m_Player_SwitchWatchMode = m_Player.FindAction("SwitchWatchMode", throwIfNotFound: true);
|
||||
m_Player_Edit = m_Player.FindAction("Edit", throwIfNotFound: true);
|
||||
}
|
||||
|
||||
~@PlayerInputActions()
|
||||
@@ -247,6 +310,9 @@ namespace Input
|
||||
private readonly InputAction m_Player_Look;
|
||||
private readonly InputAction m_Player_Jump;
|
||||
private readonly InputAction m_Player_Interact;
|
||||
private readonly InputAction m_Player_Pause;
|
||||
private readonly InputAction m_Player_SwitchWatchMode;
|
||||
private readonly InputAction m_Player_Edit;
|
||||
public struct PlayerActions
|
||||
{
|
||||
private @PlayerInputActions m_Wrapper;
|
||||
@@ -255,6 +321,9 @@ namespace Input
|
||||
public InputAction @Look => m_Wrapper.m_Player_Look;
|
||||
public InputAction @Jump => m_Wrapper.m_Player_Jump;
|
||||
public InputAction @Interact => m_Wrapper.m_Player_Interact;
|
||||
public InputAction @Pause => m_Wrapper.m_Player_Pause;
|
||||
public InputAction @SwitchWatchMode => m_Wrapper.m_Player_SwitchWatchMode;
|
||||
public InputAction @Edit => m_Wrapper.m_Player_Edit;
|
||||
public InputActionMap Get() { return m_Wrapper.m_Player; }
|
||||
public void Enable() { Get().Enable(); }
|
||||
public void Disable() { Get().Disable(); }
|
||||
@@ -276,6 +345,15 @@ namespace Input
|
||||
@Interact.started += instance.OnInteract;
|
||||
@Interact.performed += instance.OnInteract;
|
||||
@Interact.canceled += instance.OnInteract;
|
||||
@Pause.started += instance.OnPause;
|
||||
@Pause.performed += instance.OnPause;
|
||||
@Pause.canceled += instance.OnPause;
|
||||
@SwitchWatchMode.started += instance.OnSwitchWatchMode;
|
||||
@SwitchWatchMode.performed += instance.OnSwitchWatchMode;
|
||||
@SwitchWatchMode.canceled += instance.OnSwitchWatchMode;
|
||||
@Edit.started += instance.OnEdit;
|
||||
@Edit.performed += instance.OnEdit;
|
||||
@Edit.canceled += instance.OnEdit;
|
||||
}
|
||||
|
||||
private void UnregisterCallbacks(IPlayerActions instance)
|
||||
@@ -292,6 +370,15 @@ namespace Input
|
||||
@Interact.started -= instance.OnInteract;
|
||||
@Interact.performed -= instance.OnInteract;
|
||||
@Interact.canceled -= instance.OnInteract;
|
||||
@Pause.started -= instance.OnPause;
|
||||
@Pause.performed -= instance.OnPause;
|
||||
@Pause.canceled -= instance.OnPause;
|
||||
@SwitchWatchMode.started -= instance.OnSwitchWatchMode;
|
||||
@SwitchWatchMode.performed -= instance.OnSwitchWatchMode;
|
||||
@SwitchWatchMode.canceled -= instance.OnSwitchWatchMode;
|
||||
@Edit.started -= instance.OnEdit;
|
||||
@Edit.performed -= instance.OnEdit;
|
||||
@Edit.canceled -= instance.OnEdit;
|
||||
}
|
||||
|
||||
public void RemoveCallbacks(IPlayerActions instance)
|
||||
@@ -315,6 +402,9 @@ namespace Input
|
||||
void OnLook(InputAction.CallbackContext context);
|
||||
void OnJump(InputAction.CallbackContext context);
|
||||
void OnInteract(InputAction.CallbackContext context);
|
||||
void OnPause(InputAction.CallbackContext context);
|
||||
void OnSwitchWatchMode(InputAction.CallbackContext context);
|
||||
void OnEdit(InputAction.CallbackContext context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user