协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
unity-input-system【开发与工程】Unity New Input System configuration skill for action maps, device bindings, control schemes, and cross-platform input handling.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
New Input System configuration and implementation for Unity.
This skill provides capabilities for implementing Unity's New Input System, including action maps, device support, and cross-platform input handling.
// Generated PlayerInput class usage
public class PlayerController : MonoBehaviour
{
private PlayerInputActions inputActions;
void Awake()
{
inputActions = new PlayerInputActions();
}
void OnEnable()
{
inputActions.Gameplay.Enable();
inputActions.Gameplay.Jump.performed += OnJump;
inputActions.Gameplay.Move.performed += OnMove;
}
void OnDisable()
{
inputActions.Gameplay.Disable();
}
void OnJump(InputAction.CallbackContext ctx)
{
// Handle jump
}
void OnMove(InputAction.CallbackContext ctx)
{
Vector2 movement = ctx.ReadValue<Vector2>();
}
}
public void StartRebinding(InputAction action)
{
action.PerformInteractiveRebinding()
.WithControlsExcluding("Mouse")
.OnComplete(operation => {
operation.Dispose();
SaveBindings();
})
.Start();
}