SDT0401: Invalid Input Mapping Type
| Property | Value |
|---|---|
| Rule ID | SDT0401 |
| Title | Invalid Input Mapping Type |
| Category | Input |
| Severity | Error |
Cause
An element attempting to register as an input mapping container is not a valid C# enum.
Rule Description
The input framework explicitly requires a closed, static enumerable set of constants to process control binding dictionaries. Passing classes or struct objects to target configurations breaks input lookup mappings.
How to Fix Violations
Convert the target type registry strictly into an enum.
Violation:
public class GameplayState : PropScript
{
// Invalid mapping!
[AxisInput(10)]
public float MoveForward;
[AxisInput(11)]
public float MoveRight;
}
Fix:
[InputMapper]
public enum GameplayInput
{
[MappedAxis]
MoveForward,
[MappedAxis]
MoveRight,
}
public class GameplayState : PropScript
{
// Correct mapping
[AxisInput(GameplayInput.MoveForward)]
public float MoveForward;
[AxisInput(GameplayInput.MoveRight)]
public float MoveRight;
}
When to Suppress Warnings
Danger
Do not suppress this error. The core input manager relies on underlying integer enums to register input arrays; anything else generates catastrophic mapping type failures.