public void OnGUI()
        {
            if (gamepadProfiles == null)
            {
                gamepadProfiles = GamepadHandler.LoadAllGamepadProfiles();
            }

            if (gamepadProfiles.Length <= 0 || (hasSelection && selectedProfileIndex >= gamepadProfiles.Length))
            {
                InputManagerWindow.ResetSelections();
            }

            float testButtonHeight = 30;

            if (Application.isPlaying)
            {
                testButtonHeight += 45;
                if (testSceneEditor.lastScene != null)
                {
                    testButtonHeight += 44;
                }
            }

            if (HierarchyGUI.Draw(InputManagerWindow.tabsOffYOffset + testButtonHeight, false, BuildHierarchyElementsList(), DrawSelected, CreateEditMenu))
            {
                OnNewProfileSelection(gamepadProfiles[selectedProfileIndex]);
            }

            Rect testRect = new Rect(0.0f, 0.0f, InputManagerWindow.width, testButtonHeight);

            testRect.y += InputManagerWindow.tabsOffYOffset;

            GUILayout.BeginArea(testRect);

            for (int i = 0; i < 1; i++)
            {
                EditorGUILayout.Space();
            }

            if (Application.isPlaying)
            {
                if (testSceneEditor.lastScene != null)
                {
                    EditorGUILayout.HelpBox("Do not close the Input Manager window while in the gamepad testing scene.\n\nOr you will not be taken back to the original scene you were working on...", MessageType.Warning);
                }
                EditorGUILayout.HelpBox("[Play Mode]: Any new Profiles will be active the next time you enter play mode.", MessageType.Info);
            }
            else
            {
                if (GUILayout.Button("Start Gamepad Inputs Testing Scene"))
                {
                    testSceneEditor.StartTestScene();
                }
            }

            GUILayout.EndArea();
        }
 void ReloadProfilesAndRepaint()
 {
     gamepadProfiles = GamepadHandler.LoadAllGamepadProfiles();
     InputManagerWindow.ResetSelections();
     InputManagerWindow.instance.Repaint();
 }