feat(Connect): 完成连线基本玩法,

This commit is contained in:
2025-10-19 19:38:52 +08:00
parent e14e8925de
commit f3d73ab65a
34 changed files with 2528 additions and 988 deletions

View File

@@ -91,6 +91,33 @@ namespace Script.Gameplay.Input
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
},
{
""name"": ""Connect"",
""type"": ""Button"",
""id"": ""8600cc5b-8ea6-421a-a0f8-11237b50721f"",
""expectedControlType"": """",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
},
{
""name"": ""SetOutput"",
""type"": ""Button"",
""id"": ""c4b0a3bb-49d9-44fe-b302-9ee2b657481a"",
""expectedControlType"": """",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
},
{
""name"": ""SetInput"",
""type"": ""Button"",
""id"": ""fdd72692-b6cc-48ee-af6f-03ffabf29853"",
""expectedControlType"": """",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
}
],
""bindings"": [
@@ -207,13 +234,46 @@ namespace Script.Gameplay.Input
{
""name"": """",
""id"": ""9e9bf8ec-8b3e-4230-a10c-ae874395711a"",
""path"": ""<Keyboard>/x"",
""path"": ""<Keyboard>/e"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""Edit"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""1c0b4a38-f715-4171-9f41-95afccb50e0f"",
""path"": ""<Keyboard>/c"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""Connect"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""86108527-eb72-48d4-99cf-b1135b9b85f1"",
""path"": ""<Mouse>/leftButton"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""SetOutput"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""1bb29430-c526-48c4-92c8-ef5e44639a7c"",
""path"": ""<Mouse>/rightButton"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""SetInput"",
""isComposite"": false,
""isPartOfComposite"": false
}
]
}
@@ -229,6 +289,9 @@ namespace Script.Gameplay.Input
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);
m_Player_Connect = m_Player.FindAction("Connect", throwIfNotFound: true);
m_Player_SetOutput = m_Player.FindAction("SetOutput", throwIfNotFound: true);
m_Player_SetInput = m_Player.FindAction("SetInput", throwIfNotFound: true);
}
~@PlayerInputActions()
@@ -302,6 +365,9 @@ namespace Script.Gameplay.Input
private readonly InputAction m_Player_Pause;
private readonly InputAction m_Player_SwitchWatchMode;
private readonly InputAction m_Player_Edit;
private readonly InputAction m_Player_Connect;
private readonly InputAction m_Player_SetOutput;
private readonly InputAction m_Player_SetInput;
public struct PlayerActions
{
private @PlayerInputActions m_Wrapper;
@@ -313,6 +379,9 @@ namespace Script.Gameplay.Input
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 InputAction @Connect => m_Wrapper.m_Player_Connect;
public InputAction @SetOutput => m_Wrapper.m_Player_SetOutput;
public InputAction @SetInput => m_Wrapper.m_Player_SetInput;
public InputActionMap Get() { return m_Wrapper.m_Player; }
public void Enable() { Get().Enable(); }
public void Disable() { Get().Disable(); }
@@ -343,6 +412,15 @@ namespace Script.Gameplay.Input
@Edit.started += instance.OnEdit;
@Edit.performed += instance.OnEdit;
@Edit.canceled += instance.OnEdit;
@Connect.started += instance.OnConnect;
@Connect.performed += instance.OnConnect;
@Connect.canceled += instance.OnConnect;
@SetOutput.started += instance.OnSetOutput;
@SetOutput.performed += instance.OnSetOutput;
@SetOutput.canceled += instance.OnSetOutput;
@SetInput.started += instance.OnSetInput;
@SetInput.performed += instance.OnSetInput;
@SetInput.canceled += instance.OnSetInput;
}
private void UnregisterCallbacks(IPlayerActions instance)
@@ -368,6 +446,15 @@ namespace Script.Gameplay.Input
@Edit.started -= instance.OnEdit;
@Edit.performed -= instance.OnEdit;
@Edit.canceled -= instance.OnEdit;
@Connect.started -= instance.OnConnect;
@Connect.performed -= instance.OnConnect;
@Connect.canceled -= instance.OnConnect;
@SetOutput.started -= instance.OnSetOutput;
@SetOutput.performed -= instance.OnSetOutput;
@SetOutput.canceled -= instance.OnSetOutput;
@SetInput.started -= instance.OnSetInput;
@SetInput.performed -= instance.OnSetInput;
@SetInput.canceled -= instance.OnSetInput;
}
public void RemoveCallbacks(IPlayerActions instance)
@@ -394,6 +481,9 @@ namespace Script.Gameplay.Input
void OnPause(InputAction.CallbackContext context);
void OnSwitchWatchMode(InputAction.CallbackContext context);
void OnEdit(InputAction.CallbackContext context);
void OnConnect(InputAction.CallbackContext context);
void OnSetOutput(InputAction.CallbackContext context);
void OnSetInput(InputAction.CallbackContext context);
}
}
}