Route input remaps through typed commit boundary
This commit is contained in:
parent
22e7d0a972
commit
a3c65aa8e0
5 changed files with 62 additions and 28 deletions
|
|
@ -63,6 +63,35 @@ public class RuntimePlayerInputSettings
|
|||
{
|
||||
public Dictionary<(string action, int binding), string> InputActionMap = new Dictionary<(string action, int binding), string>();
|
||||
public List<string> ActionBarInputs = new List<string>();
|
||||
|
||||
public void SetBindingOverride(string action, int binding, string inputSystemPath)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(action))
|
||||
throw new ArgumentException("Action name is required.", nameof(action));
|
||||
if (binding < 0)
|
||||
throw new ArgumentOutOfRangeException(nameof(binding));
|
||||
if (string.IsNullOrWhiteSpace(inputSystemPath))
|
||||
throw new ArgumentException("Input path is required.", nameof(inputSystemPath));
|
||||
|
||||
InputActionMap[(action, binding)] = inputSystemPath;
|
||||
}
|
||||
|
||||
public void SetActionBarInputEnabled(string inputSystemPath, bool enabled)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(inputSystemPath))
|
||||
throw new ArgumentException("Input path is required.", nameof(inputSystemPath));
|
||||
|
||||
var index = ActionBarInputs.IndexOf(inputSystemPath);
|
||||
if (enabled)
|
||||
{
|
||||
if (index < 0)
|
||||
ActionBarInputs.Add(inputSystemPath);
|
||||
}
|
||||
else if (index >= 0)
|
||||
{
|
||||
ActionBarInputs.RemoveAt(index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public enum Quality
|
||||
|
|
|
|||
Loading…
Reference in a new issue