public void OnGUI()
        {
            EditorGUI.BeginChangeCheck();

            EnsureGUIStyles();

            if ((schemes.Count <= 0) || (IsControlSchemeSelected && selectedControlSchemeIndex >= schemes.Count) || (IsActionSelected && selectedActionIndex >= schemes[selectedControlSchemeIndex].Actions.Count))
            {
                InputManagerWindow.ResetSelections();
            }


            // HierarchyGUI.UpdateHierarchyPanelWidth(InputManagerWindow.tabsOffYOffset);

            // HierarchyGUI.DrawMainPanel(InputManagerWindow.tabsOffYOffset, DrawSelected);

            // if (HierarchyGUI.DrawHierarchyPanel(InputManagerWindow.tabsOffYOffset, true, BuildHierarchyElementsList())) {
            //  ResetKeyFields();
            // }

            if (HierarchyGUI.Draw(InputManagerWindow.tabsOffYOffset, true, BuildHierarchyElementsList(), DrawSelected, CreateFileMenu))
            {
                ResetKeyFields();
            }

            // HierarchyGUI.DrawMainToolbar(CreateFileMenu, InputManagerWindow.tabsOffYOffset);



            if (EditorGUI.EndChangeCheck())
            {
                guiChanged = true;
            }
        }
        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();
        }
Пример #3
0
        public void OnEnable(HierarchyGUI hierarchyGUI)
        {
            this.hierarchyGUI = hierarchyGUI;

            m_gravityInfo        = new GUIContent("Gravity When Axis Query", "The speed(in units/sec) at which a digital axis falls towards neutral.");
            m_sensitivityInfo    = new GUIContent("Sensitivity When Axis Query", "The speed(in units/sec) at which an axis moves towards the target value.");
            m_snapInfo           = new GUIContent("Snap When Axis Query", "If input switches direction, do we snap to neutral and continue from there?");   // For digital axes only.");
            m_deadZoneInfo       = new GUIContent("Dead Zone", "Size of analog dead zone. Values within this range map to neutral.");
            m_plusButtonContent  = new GUIContent(GetUnityIcon("ol plus"));
            m_minusButtonContent = new GUIContent(GetUnityIcon("ol minus"));
            m_upButtonContent    = new GUIContent(GetCustomIcon("input_editor_arrow_up"));
            m_downButtonContent  = new GUIContent(GetCustomIcon("input_editor_arrow_down"));

            InitializeLoadedElements();
        }
 public void OnEnable(HierarchyGUI hierarchyGUI)
 {
     this.hierarchyGUI = hierarchyGUI;
 }
 void DisposeManagerWindow(bool repeat)
 {
     instance = null;
     controlSchemes.Dispose(repeat);
     HierarchyGUI.Dispose();
 }