Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions Assets/Samples/CustomComposite/CustomComposite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ public override void OnGUI()
target.scaleFactor = EditorGUILayout.Slider(m_ScaleFactorLabel, currentValue, 0, 2);
}

#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
public override void OnDrawVisualElements(VisualElement root, Action onChangedCallback)
{
var slider = new Slider(m_ScaleFactorLabel.text, 0, 2)
Expand All @@ -167,8 +166,6 @@ public override void OnDrawVisualElements(VisualElement root, Action onChangedCa
root.Add(slider);
}

#endif

private GUIContent m_ScaleFactorLabel = new GUIContent("Scale Factor");
}
#endif
8 changes: 1 addition & 7 deletions Assets/Samples/ProjectWideActions/ProjectWideActions.asmdef
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [
{
"name": "Unity",
"expression": "2022.3",
"define": "UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS"
}
],
"versionDefines": [],
"noEngineReferences": false
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS

namespace UnityEngine.InputSystem.Samples.ProjectWideActions
{
public class ProjectWideActionsExample : MonoBehaviour
Expand Down Expand Up @@ -76,5 +74,3 @@ void Update()
}
} // class ProjectWideActionsExample
} // namespace UnityEngine.InputSystem.Samples.ProjectWideActions

#endif
2 changes: 0 additions & 2 deletions Assets/Tests/InputSystem.Editor/ControlSchemeEditorTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
using NUnit.Framework;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Editor;
Expand Down Expand Up @@ -405,4 +404,3 @@ public void ChangeBindingsControlSchemesCommand_CanRemoveControlSchemes()
Assert.That(groupsProperty.stringValue, Is.EqualTo(string.Empty));
}
}
#endif
2 changes: 1 addition & 1 deletion Assets/Tests/InputSystem.Editor/CustomProcessorEnumTest.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if UNITY_EDITOR && UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS && UNITY_6000_0_OR_NEWER
#if UNITY_EDITOR && UNITY_6000_0_OR_NEWER

using System;
using NUnit.Framework;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS // Mimic implementation guard

using System;
using System.Collections;
using NUnit.Framework;
Expand Down Expand Up @@ -168,5 +166,3 @@ public IEnumerator FieldObjectIsNullWhenReferenceIsInvalid()
Assert.That(fieldObj, Is.Null);
}
}

#endif // UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
4 changes: 1 addition & 3 deletions Assets/Tests/InputSystem.Editor/InputActionsEditorTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// UITK TreeView is not supported in earlier versions
// Therefore the UITK version of the InputActionAsset Editor is not available on earlier Editor versions either.
#if UNITY_EDITOR && UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS && UNITY_6000_0_OR_NEWER
#if UNITY_EDITOR && UNITY_6000_0_OR_NEWER

using NUnit.Framework;
using System;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS

using System;
using System.Collections.Generic;
using System.IO;
Expand Down Expand Up @@ -496,5 +494,3 @@ public void ProjectWideActions_CanBeAssignedAndFiresCallbackWhenAssignedAndDiffe
Assert.That(m_CallbackCount, Is.EqualTo(2));
}
}

#endif
4 changes: 1 addition & 3 deletions Assets/Tests/InputSystem.Editor/SelectorsTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// UITK TreeView is not supported in earlier versions
// Therefore the UITK version of the InputActionAsset Editor is not available on earlier Editor versions either.
#if UNITY_EDITOR && UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
#if UNITY_EDITOR
using System;
using System.Collections.Generic;
using System.Linq;
Expand Down
2 changes: 0 additions & 2 deletions Assets/Tests/InputSystem.Editor/TestData.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
Expand Down Expand Up @@ -71,4 +70,3 @@ public static Generator<IEnumerable<T>> N<T>(Generator<T> generator, int count)
});
}
}
#endif
2 changes: 0 additions & 2 deletions Assets/Tests/InputSystem.Editor/TestDataGenerators.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
using System.Collections.Generic;
using UnityEngine.InputSystem;

Expand Down Expand Up @@ -65,4 +64,3 @@ public static InputControlScheme WithName(this InputControlScheme controlScheme,
return new InputControlScheme(name, controlScheme.deviceRequirements, controlScheme.bindingGroup);
}
}
#endif
2 changes: 1 addition & 1 deletion Assets/Tests/InputSystem.Editor/UIToolkitBaseTestWindow.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// UITK TreeView is not supported in earlier versions
// Therefore the UITK version of the InputActionAsset Editor is not available on earlier Editor versions either.
#if UNITY_EDITOR && UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS && UNITY_6000_0_OR_NEWER
#if UNITY_EDITOR && UNITY_6000_0_OR_NEWER

using NUnit.Framework;
using System;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@
"defineConstraints": [
"UNITY_INCLUDE_TESTS"
],
"versionDefines": [
{
"name": "Unity",
"expression": "2022.3",
"define": "UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS"
}
],
"versionDefines": [],
"noEngineReferences": false
}
4 changes: 0 additions & 4 deletions Assets/Tests/InputSystem/CorePerformanceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -999,10 +999,8 @@ public void Performance_OptimizedControls_EvaluateStaleControlReadsWhenGamepadSt

var gamepad = InputSystem.AddDevice<Gamepad>();

#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
// Disable the project wide actions actions to avoid performance impact.
InputSystem.actions?.Disable();
#endif

Measure.Method(() =>
{
Expand Down Expand Up @@ -1041,10 +1039,8 @@ public void Performance_OptimizedControls_EvaluateStaleControlReadsWhenGamepadSt
.Run();


#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
// Re-enable the project wide actions actions.
InputSystem.actions?.Enable();
#endif
return;

void MethodToMeasure(Gamepad g)
Expand Down
30 changes: 0 additions & 30 deletions Assets/Tests/InputSystem/CoreTests_Actions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ partial class CoreTests
[TestCase(InputFeatureNames.kParanoidReadValueCachingChecks)]
[TestCase(InputFeatureNames.kDisableUnityRemoteSupport)]
[TestCase(InputFeatureNames.kRunPlayerUpdatesInEditMode)]
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
[TestCase(InputFeatureNames.kUseIMGUIEditorForAssets)]
#endif
public void Settings_ShouldStoreSettingsAndFeatureFlags(string featureName)
{
using (var settings = Scoped.Object(InputSettings.CreateInstance<InputSettings>()))
Expand Down Expand Up @@ -767,10 +765,8 @@ public void Actions_CanTargetMultipleControls()
[Category("Actions")]
public void Actions_CanTargetSameControlWithMultipleActions()
{
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
// Exclude project-wide actions from this test
InputSystem.actions?.Disable(); // Prevent these actions appearing in the `InputActionTrace`
#endif

var gamepad = InputSystem.AddDevice<Gamepad>();

Expand Down Expand Up @@ -3735,10 +3731,8 @@ public void Actions_CanCreateActionsWithoutAnActionMap()
[Category("Actions")]
public void Actions_CanCreateActionAssetWithMultipleActionMaps()
{
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
// Exclude project-wide actions from this test
InputSystem.actions?.Disable(); // Prevent these actions appearing in the `InputActionTrace`
#endif

var asset = ScriptableObject.CreateInstance<InputActionAsset>();

Expand Down Expand Up @@ -3989,10 +3983,8 @@ public void Actions_CanByPassControlActuationChecks_UsingPasshtroughAction()
[Category("Actions")]
public void Actions_WithMultipleBoundControls_DriveInteractionsFromControlWithGreatestActuation()
{
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
// Exclude project-wide actions from this test
InputSystem.actions?.Disable(); // Prevent these actions appearing in the `InputActionTrace`
#endif

var gamepad = InputSystem.AddDevice<Gamepad>();

Expand Down Expand Up @@ -4281,10 +4273,8 @@ public void Actions_WithMultipleBoundControls_ProcessesInteractionsOnAllActiveBi
[Category("Actions")]
public void Actions_WithMultipleBoundControls_CanHandleInteractionsThatTriggerOnlyOnButtonRelease()
{
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
// Exclude project-wide actions from this test
InputSystem.actions?.Disable(); // Prevent these actions appearing in the `InputActionTrace`
#endif

var keyboard = InputSystem.AddDevice<Keyboard>();
var gamepad = InputSystem.AddDevice<Gamepad>();
Expand Down Expand Up @@ -4816,10 +4806,8 @@ public void Actions_CanRecordActions_AndReadValueAsObject()
[Category("Actions")]
public void Actions_CanRecordAllActionsInTheSystem()
{
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
// Exclude project-wide actions from this test
InputSystem.actions?.Disable(); // Prevent these actions appearing in the `InputActionTrace`
#endif

var gamepad = InputSystem.AddDevice<Gamepad>();

Expand Down Expand Up @@ -5343,10 +5331,8 @@ public void Actions_NameInJsonIsSetToEmptyString_IfCreatedFromObjectWithNullName
[Category("Actions")]
public void Actions_CanQueryAllEnabledActions()
{
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
// Exclude project-wide actions from this test
InputSystem.actions?.Disable(); // Remove from `ListEnabledActions`
#endif

var action = new InputAction(binding: "<Gamepad>/leftStick");
action.Enable();
Expand Down Expand Up @@ -5620,11 +5606,9 @@ private InputActionMap CreateSingletonAction()
[TestCaseSource(typeof(ModificationCases))]
public void Actions_CanHandleModification(Modification modification, IInputActionCollection2 actions)
{
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
// Exclude project-wide actions from this test
InputSystem.actions?.Disable();
InputActionState.DestroyAllActionMapStates(); // Required for `onActionChange` to report correct number of changes
#endif

var gamepad = InputSystem.AddDevice<Gamepad>();

Expand Down Expand Up @@ -6512,11 +6496,9 @@ public void Actions_WhenDeviceIsRemoved_ReadingValueInActionListenersWillNotThro
[Category("Actions")]
public void Actions_WhenDeviceIsRemoved_DeviceIsRemovedFromDeviceMask()
{
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
// Exclude project-wide actions from this test
InputSystem.actions?.Disable();
InputActionState.DestroyAllActionMapStates(); // Required for `onActionChange` to report correct number of changes
#endif

var gamepad = InputSystem.AddDevice<Gamepad>();

Expand Down Expand Up @@ -6660,11 +6642,9 @@ public void Actions_ControlsUpdate_WhenDeviceConfigurationChanges_AndControlIsNo
[Category("Actions")]
public void Actions_WhenControlsUpdate_NotificationIsTriggered_ButOnlyAfterBindingsHaveFirstBeenResolved()
{
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
// Exclude project-wide actions from this test
InputSystem.actions?.Disable();
InputActionState.DestroyAllActionMapStates(); // Required for `onActionChange` to report correct number of changes
#endif

var enabledAction = new InputAction("enabledAction", binding: "<Gamepad>/leftTrigger");

Expand Down Expand Up @@ -6722,11 +6702,9 @@ public void Actions_WhenControlsUpdate_NotificationIsTriggered_ButOnlyAfterBindi
[Category("Actions")]
public void Actions_WhenControlsUpdateInActionMap_NotificationIsTriggered()
{
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
// Exclude project-wide actions from this test
InputSystem.actions?.Disable();
InputActionState.DestroyAllActionMapStates(); // Required for `onActionChange` to report correct number of changes
#endif

var actionMap = new InputActionMap("map");
actionMap.AddAction("action", binding: "<Gamepad>/leftTrigger");
Expand Down Expand Up @@ -6754,11 +6732,9 @@ public void Actions_WhenControlsUpdateInActionMap_NotificationIsTriggered()
[Category("Actions")]
public void Actions_WhenControlsUpdateInActionAsset_NotificationIsTriggered()
{
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
// Exclude project-wide actions from this test
InputSystem.actions?.Disable();
InputActionState.DestroyAllActionMapStates(); // Required for `onActionChange` to report correct number of changes
#endif

var asset = ScriptableObject.CreateInstance<InputActionAsset>();
asset.name = "asset";
Expand Down Expand Up @@ -6944,10 +6920,8 @@ public void Actions_WhenInProgress_AddingAndRemovingUnusedDevice_DoesNotAffectAc
[Category("Actions")]
public void Actions_CanFindEnabledActions()
{
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
// Exclude project-wide actions from this test
InputSystem.actions?.Disable(); // Remove from `ListEnabledActions`
#endif

var action1 = new InputAction(name: "a");
var action2 = new InputAction(name: "b");
Expand Down Expand Up @@ -11926,10 +11900,8 @@ public void Actions_CanIterateOverActionsInMap()
[Category("Actions")]
public void Actions_CanUseTouchWithActions()
{
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
// Exclude project-wide actions from this test
InputSystem.actions?.Disable(); // Prevent these actions appearing in the `InputActionTrace`
#endif

var touchscreen = InputSystem.AddDevice<Touchscreen>();

Expand Down Expand Up @@ -12001,10 +11973,8 @@ public void Actions_CanUseTouchWithActions()
[Category("Actions")]
public void Actions_CanDrivePointerInputFromTouchPenAndMouse()
{
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
// Exclude project-wide actions from this test
InputSystem.actions?.Disable(); // Prevent these actions appearing in the `InputActionTrace`
#endif

// Give us known parameters for tap detection.
InputSystem.settings.defaultTapTime = 0.5f;
Expand Down
2 changes: 0 additions & 2 deletions Assets/Tests/InputSystem/CoreTests_Actions_Interactions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -865,10 +865,8 @@ public void Actions_CanPerformDoubleTapInteraction()
[Category("Actions")]
public void Actions_CanCustomizeButtonPressPointsOfInteractions()
{
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
// Exclude project-wide actions from this test
InputSystem.actions?.Disable(); // Prevent these actions appearing in the `InputActionTrace`
#endif

var gamepad = InputSystem.AddDevice<Gamepad>();

Expand Down
Loading