Exemplo n.º 1
0
        private void HandleFileMenuOption(object arg)
        {
            FileMenuOptions option = (FileMenuOptions)arg;

            switch (option)
            {
            case FileMenuOptions.OverriteInputSettings:
                EditorToolbox.OverwriteInputSettings();
                break;

            case FileMenuOptions.CreateSnapshot:
                EditorToolbox.CreateSnapshot(_inputManager);
                break;

            case FileMenuOptions.LoadSnapshot:
                EditorToolbox.LoadSnapshot(_inputManager);
                break;

            case FileMenuOptions.Export:
                ExportInputConfigurations();
                break;

            case FileMenuOptions.Import:
                ImportInputConfigurations();
                break;

            case FileMenuOptions.ImportJoystickMapping:
                EditorToolbox.OpenImportJoystickMappingWindow(this);
                break;

            case FileMenuOptions.ConfigureForInputAdapter:
                ConfigureForInputAdapter();
                break;
            }
        }
Exemplo n.º 2
0
        private void HandleFileMenuOption(object arg)
        {
            int option = (int)arg;

            switch (option)
            {
            case 0:
                EditorToolbox.OverwriteInputSettings();
                break;

            case 1:
                EditorToolbox.CreateSnapshot(_inputManager);
                break;

            case 2:
                EditorToolbox.LoadSnapshot(_inputManager);
                break;

            case 3:
                MenuCommands.OpenForumPage();
                break;

            case 4:
                MenuCommands.OpenAboutDialog();
                break;
            }
        }
Exemplo n.º 3
0
        public override void OnInspectorGUI()
        {
            _InputManager inputManager = target as _InputManager;

            serializedObject.Update();
            GUILayout.Space(5.0f);

            GUILayout.BeginHorizontal();
            GUI.enabled = !AdvancedInputEditor.IsOpen;
            if (GUILayout.Button("Input\nEditor", GUILayout.Height(40.0f)))
            {
                AdvancedInputEditor.OpenWindow(inputManager);
            }
            GUI.enabled = true;
            if (GUILayout.Button(_createSnapshotIngo, GUILayout.Height(40.0f)))
            {
                EditorToolbox.CreateSnapshot(inputManager);
            }
            GUI.enabled = EditorToolbox.CanLoadSnapshot();
            if (GUILayout.Button("Restore\nSnapshot", GUILayout.Height(40.0f)))
            {
                EditorToolbox.LoadSnapshot(inputManager);
            }
            GUI.enabled = true;
            GUILayout.EndHorizontal();

            GUILayout.Space(5.0f);
            EditorGUILayout.PropertyField(_playerOneDefault);
            EditorGUILayout.PropertyField(_playerTwoDefault);
            EditorGUILayout.PropertyField(_playerThreeDefault);
            EditorGUILayout.PropertyField(_playerFourDefault);
            EditorGUILayout.PropertyField(_dontDestroyOnLoad);
            EditorGUILayout.PropertyField(_ignoreTimescale);
            EditorGUILayout.PropertyField(_intputConfigurations);
            if (_intputConfigurations.isExpanded)
            {
                EditorGUI.indentLevel++;
                int arraySize = EditorGUILayout.DelayedIntField("Size", _intputConfigurations.arraySize);
                if (arraySize != _intputConfigurations.arraySize)
                {
                    _intputConfigurations.arraySize = arraySize;
                }

                for (int i = 0; i < _intputConfigurations.arraySize; i++)
                {
                    DisplayInputConfigurations(_intputConfigurations.GetArrayElementAtIndex(i));
                }

                EditorGUI.indentLevel--;
            }

            GUILayout.Space(5.0f);
            serializedObject.ApplyModifiedProperties();
        }
        private void HandleFileMenuOption(object arg)
        {
            FileMenuOptions option = (FileMenuOptions)arg;

            switch (option)
            {
            case FileMenuOptions.OverriteInputSettings:
                EditorToolbox.OverwriteInputSettings();
                break;

            case FileMenuOptions.CreateSnapshot:
                EditorToolbox.CreateSnapshot(_inputManager);
                break;

            case FileMenuOptions.LoadSnapshot:
                EditorToolbox.LoadSnapshot(_inputManager);
                break;

            case FileMenuOptions.Export:
                ExportInputConfigurations();
                break;

            case FileMenuOptions.Import:
                ImportInputConfigurations();
                break;

            case FileMenuOptions.ImportJoystickMapping:
                EditorToolbox.OpenImportJoystickMappingWindow(this);
                break;

            case FileMenuOptions.ConfigureForInputAdapter:
                LoadInputConfigurationsFromResource(ResourcePaths.INPUT_ADAPTER_DEFAULT_CONFIG);
                break;

            case FileMenuOptions.CreateDefaultInputConfig:
                LoadInputConfigurationsFromResource(ResourcePaths.INPUT_MANAGER_DEFAULT_CONFIG);
                break;
            }
        }