assembly-definitions
Assembly definition management — when to create asmdefs, reference rules, Editor/Runtime/Test separation, platform filters, compilation speed optimization.
New Input System — action maps, PlayerInput component, generated C# classes, runtime rebinding, multi-device support, input buffering.
$ npx -y skills add XeldarAlz/everything-claude-unity --skill input-system --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/input-systemContext preview
The summary Claude sees to decide when to auto-load this skill.
New Input System — action maps, PlayerInput component, generated C# classes, runtime rebinding, multi-device support, input buffering.
name: input-system description: "New Input System — action maps, PlayerInput component, generated C# classes, runtime rebinding, multi-device support, input buffering." globs: ["**/*.inputactions", "**/Input*.cs", "**/PlayerInput*"]
Create an Input Action Asset: Assets > Create > Input Actions. This is the central configuration for all input bindings.
Organize actions into maps based on context:
PlayerControls.inputactions
|-- Player (gameplay)
| |-- Move (Value, Vector2)
| |-- Look (Value, Vector2)
| |-- Jump (Button)
| |-- Attack (Button)
| |-- Interact (Button)
|
|-- UI (menu navigation)
| |-- Navigate (Value, Vector2)
| |-- Submit (Button)
| |-- Cancel (Button)
|
|-- Menu (pause/settings)
|-- Pause (Button)In the Input Action Asset inspector, check "Generate C# Class" and click Apply. This is the recommended approach.
using UnityEngine;
using UnityEngine.InputSystem;
public class PlayerController : MonoBehaviour
{
private PlayerControls _controls;
private Vector2 _moveInput;
private void Awake()
{
_controls = new PlayerControls();
}
private void OnEnable()
{
_controls.Player.Enable();
_controls.Player.Move.performed += OnMove;
_controls.Player.Move.canceled += OnMove;
_controls.Player.Jump.performed += OnJump;
_controls.Player.Attack.performed += OnAttack;
}
private void OnDisable()
{
_controls.Player.Move.performed -= OnMove;
_controls.Player.Move.canceled -= OnMove;
_controls.Player.Jump.performed -= OnJump;
_controls.Player.Attack.performed -= OnAttack;
_controls.Player.Disable();
}
private void OnMove(InputAction.CallbackContext ctx)
{
_moveInput = ctx.ReadValue<Vector2>();
}
private void OnJump(InputAction.CallbackContext ctx)
{
// Jump logic
}
private void OnAttack(InputAction.CallbackContext ctx)
{
// Attack logic
}
private void Update()
{
transform.Translate(new Vector3(_moveInput.x, 0, _moveInput.y) * Time.deltaTime * 5f);
}
}The PlayerInput component provides an easier but less flexible approach.
| Mode | Pros | Cons | |------|------|------| | Send Messages | Simple, no setup | Uses SendMessage (slow, no type safety) | | Broadcast Messages | Reaches child objects | Same issues as SendMessages | | Invoke Unity Events | Inspector-assigned, flexible | Requires wiring in Inspector | | Invoke C# Events | Best performance, type-safe | Requires code subscription |
using UnityEngine;
using UnityEngine.InputSystem;
[RequireComponent(typeof(PlayerInput))]
public class PlayerInputHandler : MonoBehaviour
{
private PlayerInput _playerInput;
private void Awake()
{
_playerInput = GetComponent<PlayerInput>();
}
private void OnEnable()
{
_playerInput.onActionTriggered += OnActionTriggered;
}
private void OnDisable()
{
_playerInput.onActionTriggered -= OnActionTriggered;
}
private void OnActionTriggered(InputAction.CallbackContext ctx)
{
switch (ctx.action.name)
{
case "Move":
HandleMove(ctx.ReadValue<Vector2>());
break;
case "Jump":
if (ctx.performed) HandleJump();
break;
}
}
private void HandleMove(Vector2 input) { /* ... */ }
private void HandleJump() { /* ... */ }
}action.started += ctx => { }; // Input begins (button starts pressing)
action.performed += ctx => { }; // Input completes (button fully pressed)
action.canceled += ctx => { }; // Input releasedprivate void Update()
{
// Polling approach — simpler but less event-driven
Vector2 move = _controls.Player.Move.ReadValue<Vector2>();
bool jumpPressed = _controls.Player.Jump.WasPressedThisFrame();
bool jumpReleased = _controls.Player.Jump.WasReleasedThisFrame();
bool jumpHeld = _controls.Player.Jump.IsPressed();
}public class InputMapSwitcher : MonoBehaviour
{
private PlayerControls _controls;
public void SwitchToUI()
{
_controls.Player.Disable();
_controls.UI.Enable();
}
public void SwitchToGameplay()
{
_controls.UI.Disable();
_controls.Player.Enable();
}
public void SwitchToMenu()
{
_controls.Player.Disable();
_controls.UI.Disable();
_controls.Menu.Enable();
}
}In the Input Action Asset, add a 2D Vector composite to a Vector2 action:
For key combos like Ctrl+S:
using UnityEngine;
using UnityEngine.InputSystem;
using TMPro;
public class RebindManager : MonoBehaviour
{
[SerializeField] private InputActionReference actionToRebind;
[SerializeField] private TMP_Text bindingDisplayText;
[SerializeField] private GameObject waitingForInputUI;
private InputActionRebindingExtensions.RebindingOperation _rebindOperation;
public void StartRebinding()
{
actionToRebind.action.Disable();The ultimate Claude Code toolkit for Unity game development. A production-ready, plug-and-play system that gives Claude Code deep Unity expertise — from writing performant C# to building scenes, profiling performance, and triggering iOS/Android builds — all
Assembly definition management — when to create asmdefs, reference rules, Editor/Runtime/Test separation, platform filters, compilation speed optimization.
Structured commit trailers — adds Constraint, Rejected, Scope-risk, and Not-tested metadata to commit messages. Captures architectural decisions and known gaps…
Ambiguity gating — detects vague feature requests and forces structured requirements gathering with scoring across scope, platform, performance, integration,…
Event system patterns — C# events, UnityEvent, SO event channels, static EventBus. When to use each, zero-allocation patterns, memory leak prevention.
Configures Claude Code's statusline to display Unity workflow state — current phase, active agent, files modified, and session duration.
Post-debugging knowledge extraction — captures non-obvious, codebase-specific learnings that pass quality gates. Invoke after resolving tricky bugs or…