Ejemplo n.º 1
0
 public static bool ScanInputForControlRebind(InputBinding inputBinding, bool changingPositiveDigitalAxis, Action onStopScan)
 {
     init(); return(CustomProjectInputs.ScanInputForControlRebind(inputBinding, changingPositiveDigitalAxis, onStopScan));
 }
        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;
                }
            }
        }