// Returns true, if everything is done:
        private bool ManageInputSettings()
        {
            bool allDone = true;

            EditorGUILayout.BeginHorizontal();

            EditorGUILayout.LabelField(new GUIContent("Set up InputManager axes", "Input axes are required to use the xBox controller in the Deep Space. Buttons will work without this, axes set up joysticks and triggers."), EditorStyles.label, GUILayout.MaxWidth(_leftLabelMaxWidth));

            if (InputManagerEditor.AxisDefined(_axisHorizontalLeft) &&
                InputManagerEditor.AxisDefined(_axisVerticalLeft) &&
                InputManagerEditor.AxisDefined(_axisHorizontalRight) &&
                InputManagerEditor.AxisDefined(_axisVerticalRight) &&
                InputManagerEditor.AxisDefined(_axisDPadHorizontal) &&
                InputManagerEditor.AxisDefined(_axisDPadVertical) &&
                InputManagerEditor.AxisDefined(_axisShoulderTriggerL2) &&
                InputManagerEditor.AxisDefined(_axisShoulderTriggerR2))
            {
                EditorGUILayout.LabelField("(All set up)", EditorStyles.label);
            }
            else
            {
                allDone = false;

                if (GUILayout.Button("Set it up"))
                {
                    AddRequiredInputAxes();
                }
            }

            EditorGUILayout.EndHorizontal();

            return(allDone);
        }
 private void AddRequiredInputAxes()
 {
     if (InputManagerEditor.AxisDefined(_axisHorizontalLeft) == false)
     {
         InputManagerEditor.AddAxis(new InputManagerEditor.InputAxis()
         {
             name = _axisHorizontalLeft, dead = 0.19f, sensitivity = 1f, type = InputManagerEditor.AxisType.JoystickAxis, axis = 1
         });
     }
     if (InputManagerEditor.AxisDefined(_axisVerticalLeft) == false)
     {
         InputManagerEditor.AddAxis(new InputManagerEditor.InputAxis()
         {
             name = _axisVerticalLeft, dead = 0.19f, sensitivity = 1f, type = InputManagerEditor.AxisType.JoystickAxis, axis = 2, invert = true
         });
     }
     if (InputManagerEditor.AxisDefined(_axisHorizontalRight) == false)
     {
         InputManagerEditor.AddAxis(new InputManagerEditor.InputAxis()
         {
             name = _axisHorizontalRight, dead = 0.19f, sensitivity = 1f, type = InputManagerEditor.AxisType.JoystickAxis, axis = 4
         });
     }
     if (InputManagerEditor.AxisDefined(_axisVerticalRight) == false)
     {
         InputManagerEditor.AddAxis(new InputManagerEditor.InputAxis()
         {
             name = _axisVerticalRight, dead = 0.19f, sensitivity = 1f, type = InputManagerEditor.AxisType.JoystickAxis, axis = 5, invert = true
         });
     }
     if (InputManagerEditor.AxisDefined(_axisDPadHorizontal) == false)
     {
         InputManagerEditor.AddAxis(new InputManagerEditor.InputAxis()
         {
             name = _axisDPadHorizontal, dead = 0.19f, sensitivity = 1f, type = InputManagerEditor.AxisType.JoystickAxis, axis = 6
         });
     }
     if (InputManagerEditor.AxisDefined(_axisDPadVertical) == false)
     {
         InputManagerEditor.AddAxis(new InputManagerEditor.InputAxis()
         {
             name = _axisDPadVertical, dead = 0.19f, sensitivity = 1f, type = InputManagerEditor.AxisType.JoystickAxis, axis = 7
         });
     }
     if (InputManagerEditor.AxisDefined(_axisShoulderTriggerL2) == false)
     {
         InputManagerEditor.AddAxis(new InputManagerEditor.InputAxis()
         {
             name = _axisShoulderTriggerL2, dead = 0.19f, sensitivity = 1f, type = InputManagerEditor.AxisType.JoystickAxis, axis = 9
         });
     }
     if (InputManagerEditor.AxisDefined(_axisShoulderTriggerR2) == false)
     {
         InputManagerEditor.AddAxis(new InputManagerEditor.InputAxis()
         {
             name = _axisShoulderTriggerR2, dead = 0.19f, sensitivity = 1f, type = InputManagerEditor.AxisType.JoystickAxis, axis = 10
         });
     }
 }