private void ReadInputBinding_V2(InputAction action, XmlNode node)
        {
            InputBinding binding = action.CreateNewBinding();

            foreach (XmlNode child in node.ChildNodes)
            {
                switch (child.LocalName)
                {
                case "Positive":
                    binding.Positive = StringToKey(child.InnerText);
                    break;

                case "Negative":
                    binding.Negative = StringToKey(child.InnerText);
                    break;

                case "DeadZone":
                    binding.DeadZone = ReadAsFloat(child);
                    break;

                case "Gravity":
                    binding.Gravity = ReadAsFloat(child, 1.0f);
                    break;

                case "Sensitivity":
                    binding.Sensitivity = ReadAsFloat(child, 1.0f);
                    break;

                case "Snap":
                    binding.SnapWhenReadAsAxis = ReadAsBool(child);
                    break;

                case "Invert":
                    binding.InvertWhenReadAsAxis = ReadAsBool(child);
                    break;

                case "UseNeg":
                    binding.useNegativeAxisForButton = ReadAsBool(child);
                    break;

                case "Rebindable":
                    binding.rebindable = ReadAsBool(child);
                    break;

                case "SensitivityEditable":
                    binding.sensitivityEditable = ReadAsBool(child);
                    break;

                case "InvertEditable":
                    binding.invertEditable = ReadAsBool(child);
                    break;

                case "Type":
                    binding.Type = StringToInputType(child.InnerText);
                    break;

                case "Axis":
                    binding.MouseAxis = ReadAsInt(child);
                    break;

                case "GamepadButton":
                    binding.GamepadButton = StringToGamepadButton(child.InnerText);
                    break;

                case "GamepadAxis":
                    binding.GamepadAxis = StringToGamepadAxis(child.InnerText);
                    break;
                }
            }
        }
Пример #2
0
 static bool ButtonUpQuery(InputAction action, int playerID)
 {
     return(action.GetButtonUp(playerID));
 }
Пример #3
0
 static float RawAxisQuery(InputAction action, int playerID)
 {
     return(action.GetAxisRaw(playerID));
 }
Пример #4
0
 static float NormalAxisQuery(InputAction action, int playerID)
 {
     return(action.GetAxis(playerID));
 }
Пример #5
0
 public void DeleteAction(InputAction action)
 {
     m_actions.Remove(action);
 }