Ejemplo n.º 1
0
 public void RegisterInputAction(string inputName, KeyboardMappedInputType inputType, Action onTrigger)
 {
     if (mapping.ContainsKey(inputName))
     {
         mapping[inputName].OnTrigger = onTrigger;
         mapping[inputName].Type      = inputType;
     }
     else
     {
         mapping.Add(
             inputName,
             new KeyboadMappedInput
         {
             InputName = inputName,
             OnTrigger = onTrigger,
             Type      = inputType
         });
     }
 }
Ejemplo n.º 2
0
    public void RegisterInputAction(string inputName, KeyboardMappedInputType inputType, Action onTrigger)
    {
        KeyboadMappedInput mappedInput;

        if (mapping.TryGetValue(inputName, out mappedInput))
        {
            mappedInput.OnTrigger = onTrigger;
            mappedInput.Type      = inputType;
        }
        else
        {
            mapping.Add(
                inputName,
                new KeyboadMappedInput
            {
                InputName = inputName,
                OnTrigger = onTrigger,
                Type      = inputType
            });
        }
    }