Use the generated accessor for Cycle Target Item
Regenerate AetheriaInput.cs from the committed Aetheria.inputactions so the wrapper carries Cycle Target Item, and bind it through Input.Player like the other target actions. The by-name FindAction lookup was a stopgap from when the generator could not be run outside the editor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
113164fadb
commit
e0a802084e
2 changed files with 42 additions and 5 deletions
|
|
@ -162,6 +162,16 @@ public partial class @AetheriaInput: IInputActionCollection2, IDisposable
|
|||
""initialStateCheck"": false,
|
||||
""priority"": 0
|
||||
},
|
||||
{
|
||||
""name"": ""Cycle Target Item"",
|
||||
""type"": ""Button"",
|
||||
""id"": ""3f9a2f0a-6e3f-4a53-9f5e-1a9c1e6d9f7b"",
|
||||
""expectedControlType"": ""Button"",
|
||||
""processors"": """",
|
||||
""interactions"": """",
|
||||
""initialStateCheck"": false,
|
||||
""priority"": 0
|
||||
},
|
||||
{
|
||||
""name"": ""Toggle Heatsinks"",
|
||||
""type"": ""Button"",
|
||||
|
|
@ -409,6 +419,17 @@ public partial class @AetheriaInput: IInputActionCollection2, IDisposable
|
|||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""8c2d5e77-4b18-4f0b-9a2e-6d3f7c1a5e90"",
|
||||
""path"": ""<Keyboard>/j"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": ""Keyboard&Mouse"",
|
||||
""action"": ""Cycle Target Item"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""71ac6088-1e18-4810-86be-1179918dd4a2"",
|
||||
|
|
@ -1178,6 +1199,7 @@ public partial class @AetheriaInput: IInputActionCollection2, IDisposable
|
|||
m_Player_TargetPrevious = m_Player.FindAction("Target Previous", throwIfNotFound: true);
|
||||
m_Player_TargetNext = m_Player.FindAction("Target Next", throwIfNotFound: true);
|
||||
m_Player_TargetNearest = m_Player.FindAction("Target Nearest", throwIfNotFound: true);
|
||||
m_Player_CycleTargetItem = m_Player.FindAction("Cycle Target Item", throwIfNotFound: true);
|
||||
m_Player_ToggleHeatsinks = m_Player.FindAction("Toggle Heatsinks", throwIfNotFound: true);
|
||||
m_Player_ToggleShield = m_Player.FindAction("Toggle Shield", throwIfNotFound: true);
|
||||
m_Player_ToggleStance = m_Player.FindAction("Toggle Stance", throwIfNotFound: true);
|
||||
|
|
@ -1294,6 +1316,7 @@ public partial class @AetheriaInput: IInputActionCollection2, IDisposable
|
|||
private readonly InputAction m_Player_TargetPrevious;
|
||||
private readonly InputAction m_Player_TargetNext;
|
||||
private readonly InputAction m_Player_TargetNearest;
|
||||
private readonly InputAction m_Player_CycleTargetItem;
|
||||
private readonly InputAction m_Player_ToggleHeatsinks;
|
||||
private readonly InputAction m_Player_ToggleShield;
|
||||
private readonly InputAction m_Player_ToggleStance;
|
||||
|
|
@ -1342,6 +1365,10 @@ public partial class @AetheriaInput: IInputActionCollection2, IDisposable
|
|||
/// </summary>
|
||||
public InputAction @TargetNearest => m_Wrapper.m_Player_TargetNearest;
|
||||
/// <summary>
|
||||
/// Provides access to the underlying input action "Player/CycleTargetItem".
|
||||
/// </summary>
|
||||
public InputAction @CycleTargetItem => m_Wrapper.m_Player_CycleTargetItem;
|
||||
/// <summary>
|
||||
/// Provides access to the underlying input action "Player/ToggleHeatsinks".
|
||||
/// </summary>
|
||||
public InputAction @ToggleHeatsinks => m_Wrapper.m_Player_ToggleHeatsinks;
|
||||
|
|
@ -1420,6 +1447,9 @@ public partial class @AetheriaInput: IInputActionCollection2, IDisposable
|
|||
@TargetNearest.started += instance.OnTargetNearest;
|
||||
@TargetNearest.performed += instance.OnTargetNearest;
|
||||
@TargetNearest.canceled += instance.OnTargetNearest;
|
||||
@CycleTargetItem.started += instance.OnCycleTargetItem;
|
||||
@CycleTargetItem.performed += instance.OnCycleTargetItem;
|
||||
@CycleTargetItem.canceled += instance.OnCycleTargetItem;
|
||||
@ToggleHeatsinks.started += instance.OnToggleHeatsinks;
|
||||
@ToggleHeatsinks.performed += instance.OnToggleHeatsinks;
|
||||
@ToggleHeatsinks.canceled += instance.OnToggleHeatsinks;
|
||||
|
|
@ -1476,6 +1506,9 @@ public partial class @AetheriaInput: IInputActionCollection2, IDisposable
|
|||
@TargetNearest.started -= instance.OnTargetNearest;
|
||||
@TargetNearest.performed -= instance.OnTargetNearest;
|
||||
@TargetNearest.canceled -= instance.OnTargetNearest;
|
||||
@CycleTargetItem.started -= instance.OnCycleTargetItem;
|
||||
@CycleTargetItem.performed -= instance.OnCycleTargetItem;
|
||||
@CycleTargetItem.canceled -= instance.OnCycleTargetItem;
|
||||
@ToggleHeatsinks.started -= instance.OnToggleHeatsinks;
|
||||
@ToggleHeatsinks.performed -= instance.OnToggleHeatsinks;
|
||||
@ToggleHeatsinks.canceled -= instance.OnToggleHeatsinks;
|
||||
|
|
@ -1964,6 +1997,13 @@ public partial class @AetheriaInput: IInputActionCollection2, IDisposable
|
|||
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
|
||||
void OnTargetNearest(InputAction.CallbackContext context);
|
||||
/// <summary>
|
||||
/// Method invoked when associated input action "Cycle Target Item" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
|
||||
/// </summary>
|
||||
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
|
||||
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
|
||||
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
|
||||
void OnCycleTargetItem(InputAction.CallbackContext context);
|
||||
/// <summary>
|
||||
/// Method invoked when associated input action "Toggle Heatsinks" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
|
||||
/// </summary>
|
||||
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
|
||||
|
|
|
|||
|
|
@ -405,11 +405,8 @@ public class ActionGameManager : MonoBehaviour
|
|||
|
||||
// Cut 2 (docs/fire-control-cut.md): cycles the aim point among the current target's revealed
|
||||
// subsystems -- decides nothing itself, only calls the one writer (TrySelectTargetItem), same
|
||||
// predicate (FireControl.IsRevealed) the AI path uses. No generated typed accessor exists for this
|
||||
// action yet (it was hand-authored into Aetheria.inputactions rather than regenerated through the
|
||||
// Unity Input Actions editor, unavailable here), so it is looked up by name instead of through
|
||||
// Input.Player.
|
||||
Input.asset.FindAction("Player/Cycle Target Item").performed += context =>
|
||||
// predicate (FireControl.IsRevealed) the AI path uses.
|
||||
Input.Player.CycleTargetItem.performed += context =>
|
||||
{
|
||||
var target = CurrentEntity.Target.Value;
|
||||
if (target == null) return;
|
||||
|
|
|
|||
Loading…
Reference in a new issue