public void CreateControllerInputs()
        {
            GUILayout.BeginVertical();

            //GUILayout.BeginHorizontal();
            //EditorGUILayout.LabelField("Debug Input Setup (Alpha) : ");
            //debugString = EditorGUILayout.Toggle(debugString);
            //GUILayout.EndHorizontal();

            UpdateControllerInputs();

            for (int i = 0; i < (_computerClassButtons.Length + _computerClassAxis.Length); i++)
            {
                ControllerComputerInputs.ButtonInput curcomputerButton = new ControllerComputerInputs.ButtonInput();
                string computerButton = "";
                if (i < _computerClassButtons.Length)
                {
                    computerButton = _computerClassButtons[i];
                }
                else
                {
                    int ival = i - _computerClassButtons.Length;
                    computerButton = _computerClassAxis[ival];
                }

                curcomputerButton = (ControllerComputerInputs.ButtonInput)this.GetType().GetField(computerButton).GetValue(this);

                CreateInput(curcomputerButton);
                this.GetType().GetField(computerButton).SetValue(this, curcomputerButton);
            }

            #region old code
            //Buttons
            //ABXY
            //CreateInput(ButtonA);
            //CreateInput(ButtonB);
            //CreateInput(ButtonX);
            //CreateInput(ButtonY);

            ////UP-DOWN-LEFT-RIGHT
            //CreateInput(ButtonUP);
            //CreateInput(ButtonDOWN);
            //CreateInput(ButtonLEFT);
            //CreateInput(ButtonRIGHT);

            ////R3-L3
            //CreateInput(ButtonR3);
            //CreateInput(ButtonL3);

            ////LB-RB
            //CreateInput(RightButton);
            //CreateInput(LeftButton);

            ////STart-Select
            //CreateInput(start);
            //CreateInput(select);

            ////Axis
            ////LT-RT
            //CreateInput(RightTrigger);
            //CreateInput(LeftTrigger);

            ////LS-RS
            //CreateInput(RightStickX);
            //CreateInput(RightStickY);
            //CreateInput(LeftStickX);
            //CreateInput(LeftStickY);
            #endregion
            //EditorGUILayout.Space();
            GUILayout.EndVertical();
        }
        public void UpdateButtonInputs()
        {
            for (int i = 0; i < _computerClassButtons.Length; i++)
            {
                ControllerComputerInputs.ButtonInput curcomputerButton = new ControllerComputerInputs.ButtonInput();
                string computerButton = _computerClassButtons[i];

                curcomputerButton = (ControllerComputerInputs.ButtonInput)this.GetType().GetField(computerButton).GetValue(this);

                UpdateInput(curcomputerButton);
                this.GetType().GetField(computerButton).SetValue(this, curcomputerButton);
            }
        }
    private void SetUnityButtons(int controllerId)
    {
        for (int i = 0; i < _controllerClassButtons.Length; i++)
        {
            Controller.ButtonsStates curGamePadButton = new Controller.ButtonsStates();
            ControllerComputerInputs.ButtonInput curcomputerButton = new ControllerComputerInputs.ButtonInput();

            string gamePadButton = _controllerClassButtons[i];
            string computerButton = _computerClassButtons[i];
            if (gamePadButton == "Start" || gamePadButton == "Select")
                gamePadButton = gamePadButton.ToLower();

            curGamePadButton = (Controller.ButtonsStates)GamePads[controllerId].GetType().GetField(gamePadButton).GetValue(GamePadController.GamePads[controllerId]);
            curcomputerButton = (ControllerComputerInputs.ButtonInput)computerInputs[controllerId].GetType().GetField(computerButton).GetValue(GamePadController.computerInputs[controllerId]);

            if (curcomputerButton.inputSetup)
            {
                curGamePadButton.Held = SetAndCheckIfUnityButtonIsSetup(controllerId, curcomputerButton, curGamePadButton.Held, curcomputerButton.Held);
                curGamePadButton.Pressed = SetAndCheckIfUnityButtonIsSetup(controllerId, curcomputerButton, curGamePadButton.Pressed, curcomputerButton.Pressed);
                curGamePadButton.Released = SetAndCheckIfUnityButtonIsSetup(controllerId, curcomputerButton, curGamePadButton.Released, curcomputerButton.Released);
                curGamePadButton.Zero = SetAndCheckIfUnityButtonIsSetup(controllerId, curcomputerButton, curGamePadButton.Zero, curcomputerButton.Zero);

                GamePads[controllerId].GetType().GetField(gamePadButton).SetValue(GamePads[controllerId], curGamePadButton);
            }
        }
    }