Unity-Technologies / InputSystem

An efficient and versatile input system for Unity.
Other
1.42k stars 306 forks source link

FIX: ISXB-925 Fixed an issue where changing InputSettings instance fo… #1954

Closed ekcoh closed 2 months ago

ekcoh commented 2 months ago

…r the Input System wouldn't affect feature flags.

Description

The optimization flags within InputSettings were stored as static fields for performance reasons. This makes little sense from API perspective where these are set and evaluated using a non-static API. This also leads to switching InputSettings instance having no impact on current settings. As long as these are exposed via this API they should not be static. However, I added extraction of the settings into InputManager which is represented by a static and used direct access from where its used so expecting little if any impact.

Adressing:

Changes made

Note that this fix also includes https://github.com/Unity-Technologies/InputSystem/pull/1955 since the test case would otherwise fail with debug error log on non Windows platforms.

Testing

Added 1 test case for scenario Settings_ShouldStoreSettingsAndFeatureFlags(string featureName). I didn't add a new test category at this point since none of the existing fits well so I left the test case uncategorised.

Risk

Potential risk is features not being enabled correctly for some corner-case scenarios.

Checklist

Before review:

During merge:

After merge: